summaryrefslogtreecommitdiff
path: root/fxjs/cjs_global.cpp
diff options
context:
space:
mode:
authorAdam Klein <adamk@chromium.org>2018-01-17 21:06:27 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-17 21:06:27 +0000
commit4c451ba43b19c2679467bbb7d7502b3596224038 (patch)
tree9792633226d49234499132db0d1560b2f4459c1e /fxjs/cjs_global.cpp
parentd859d5745b0a5da010ada6ee512841e1f4394ec6 (diff)
downloadpdfium-4c451ba43b19c2679467bbb7d7502b3596224038.tar.xz
Pass Isolate to v8::String::Utf8Value API
The non-Isolate version will soon be deprecated. Bug: v8:7269, v8:7282 Change-Id: I204e45bd73f5b809d6c44b77bbcf62d32e7ccbec Reviewed-on: https://pdfium-review.googlesource.com/23058 Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Jochen Eisinger <jochen@chromium.org> Commit-Queue: Jochen Eisinger <jochen@chromium.org>
Diffstat (limited to 'fxjs/cjs_global.cpp')
-rw-r--r--fxjs/cjs_global.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/fxjs/cjs_global.cpp b/fxjs/cjs_global.cpp
index 23763544f5..eb66488d8e 100644
--- a/fxjs/cjs_global.cpp
+++ b/fxjs/cjs_global.cpp
@@ -22,8 +22,9 @@
namespace {
-WideString PropFromV8Prop(v8::Local<v8::String> property) {
- v8::String::Utf8Value utf8_value(property);
+WideString PropFromV8Prop(v8::Isolate* pIsolate,
+ v8::Local<v8::String> property) {
+ v8::String::Utf8Value utf8_value(pIsolate, property);
return WideString::FromUTF8(ByteStringView(*utf8_value, utf8_value.length()));
}
@@ -42,7 +43,8 @@ void JSSpecialPropQuery(const char*,
return;
Alt* pObj = reinterpret_cast<Alt*>(pJSObj->GetEmbedObject());
- CJS_Return result = pObj->QueryProperty(PropFromV8Prop(property).c_str());
+ CJS_Return result =
+ pObj->QueryProperty(PropFromV8Prop(info.GetIsolate(), property).c_str());
info.GetReturnValue().Set(!result.HasError() ? 4 : 0);
}
@@ -61,8 +63,8 @@ void JSSpecialPropGet(const char* class_name,
return;
Alt* pObj = reinterpret_cast<Alt*>(pJSObj->GetEmbedObject());
- CJS_Return result =
- pObj->GetProperty(pRuntime, PropFromV8Prop(property).c_str());
+ CJS_Return result = pObj->GetProperty(
+ pRuntime, PropFromV8Prop(info.GetIsolate(), property).c_str());
if (result.HasError()) {
pRuntime->Error(
JSFormatErrorString(class_name, "GetProperty", result.Error()));
@@ -89,8 +91,8 @@ void JSSpecialPropPut(const char* class_name,
return;
Alt* pObj = reinterpret_cast<Alt*>(pJSObj->GetEmbedObject());
- CJS_Return result =
- pObj->SetProperty(pRuntime, PropFromV8Prop(property).c_str(), value);
+ CJS_Return result = pObj->SetProperty(
+ pRuntime, PropFromV8Prop(info.GetIsolate(), property).c_str(), value);
if (result.HasError()) {
pRuntime->Error(
JSFormatErrorString(class_name, "PutProperty", result.Error()));
@@ -112,8 +114,8 @@ void JSSpecialPropDel(const char* class_name,
return;
Alt* pObj = reinterpret_cast<Alt*>(pJSObj->GetEmbedObject());
- CJS_Return result =
- pObj->DelProperty(pRuntime, PropFromV8Prop(property).c_str());
+ CJS_Return result = pObj->DelProperty(
+ pRuntime, PropFromV8Prop(info.GetIsolate(), property).c_str());
if (result.HasError()) {
// TODO(dsinclair): Should this set the pRuntime->Error result?
// ByteString cbName =