summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/global.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-02-23 09:53:09 -0800
committerChromium commit bot <commit-bot@chromium.org>2017-02-23 18:32:16 +0000
commitc6dc69fb69e5d9974aa451d590194d568b78131b (patch)
treebec72acd1fee95da7d321ee700cf7aff23ecfe80 /fpdfsdk/javascript/global.cpp
parentfc54e054811510c3d7c8a9c6af6c90c3222c7029 (diff)
downloadpdfium-c6dc69fb69e5d9974aa451d590194d568b78131b.tar.xz
Store JS string constants as single-byte strings.
Save some space since none contain non-ascii characters. Avoid allocating C++ WideStrings just to convert back to UTF8 when defining properties. Change-Id: Id94db21b32ee7a96856c35a09f7550b54599ae13 Reviewed-on: https://pdfium-review.googlesource.com/2826 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/javascript/global.cpp')
-rw-r--r--fpdfsdk/javascript/global.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/fpdfsdk/javascript/global.cpp b/fpdfsdk/javascript/global.cpp
index eb7afb1332..7dd8ab57be 100644
--- a/fpdfsdk/javascript/global.cpp
+++ b/fpdfsdk/javascript/global.cpp
@@ -206,7 +206,7 @@ void JSGlobalAlternate::UpdateGlobalPersistentVariables() {
pData->bPersistent == 1);
pRuntime->PutObjectProperty(
m_pJSObject->ToV8Object(), pData->data.sKey.UTF8Decode(),
- pRuntime->NewString(pData->data.sData.UTF8Decode()));
+ pRuntime->NewString(pData->data.sData.UTF8Decode().AsStringC()));
break;
case JS_GlobalDataType::OBJECT: {
v8::Local<v8::Object> pObj = pRuntime->NewFxDynamicObj(-1);
@@ -335,7 +335,7 @@ void JSGlobalAlternate::PutObjectProperty(v8::Local<v8::Object> pObj,
case JS_GlobalDataType::STRING:
pRuntime->PutObjectProperty(
pObj, pObjData->sKey.UTF8Decode(),
- pRuntime->NewString(pObjData->sData.UTF8Decode()));
+ pRuntime->NewString(pObjData->sData.UTF8Decode().AsStringC()));
break;
case JS_GlobalDataType::OBJECT: {
v8::Local<v8::Object> pNewObj = pRuntime->NewFxDynamicObj(-1);