diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-06-20 16:10:13 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-06-20 16:10:13 +0000 |
commit | b6b01cb2cbaf6b38736f4dfebb9b6cdc243960f9 (patch) | |
tree | 3219404f5dbafe19205ce85d19acaf3b1178f977 /fxjs/cjs_icon.cpp | |
parent | b3345feca2741cef2073d18da414237589528dd0 (diff) | |
download | pdfium-b6b01cb2cbaf6b38736f4dfebb9b6cdc243960f9.tar.xz |
Re-work some more c_str() usage.
Many of these are converting ByteString => c_str => ByteStringView, since
the ByteStringView ctor is implicit. This is unfortunate, since that
involves a strlen() which the ByteString already knows if we use
AsStringView() instead.
This changed one test result where we can now return the string
"\0" instead of "" -- since strlen no longer eats the NUL. This
seems consistent, say, with String.fromCharCode().
Change-Id: I17f68d1a1f4b352960208f9148e68ab4c4d78bd2
Reviewed-on: https://pdfium-review.googlesource.com/35590
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/cjs_icon.cpp')
-rw-r--r-- | fxjs/cjs_icon.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fxjs/cjs_icon.cpp b/fxjs/cjs_icon.cpp index 9cf20feb73..3c293ea969 100644 --- a/fxjs/cjs_icon.cpp +++ b/fxjs/cjs_icon.cpp @@ -30,7 +30,7 @@ CJS_Icon::CJS_Icon(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime) CJS_Icon::~CJS_Icon() = default; CJS_Return CJS_Icon::get_name(CJS_Runtime* pRuntime) { - return CJS_Return(pRuntime->NewString(m_swIconName.c_str())); + return CJS_Return(pRuntime->NewString(m_swIconName.AsStringView())); } CJS_Return CJS_Icon::set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { |