summaryrefslogtreecommitdiff
path: root/fxjs/js_define.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-06-06 18:30:15 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-06 18:30:15 +0000
commitddaa40fe873070d3aae9a21b9a93848fc7e809f1 (patch)
tree222d228484da9e234a647254440e9aff98dca224 /fxjs/js_define.h
parent5caa34c64382d8587a3ec3de5edbb30976b1390d (diff)
downloadpdfium-ddaa40fe873070d3aae9a21b9a93848fc7e809f1.tar.xz
Stop using some v8::Context slot to find runtime.
Instead, use the object binding's pointer. Puts the cart back behind the horse. Change-Id: I4c06ae991b871c6e90b0e6c70b69886addca2354 Reviewed-on: https://pdfium-review.googlesource.com/33630 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fxjs/js_define.h')
-rw-r--r--fxjs/js_define.h27
1 files changed, 12 insertions, 15 deletions
diff --git a/fxjs/js_define.h b/fxjs/js_define.h
index 325642d8ce..93dfd49099 100644
--- a/fxjs/js_define.h
+++ b/fxjs/js_define.h
@@ -63,13 +63,12 @@ void JSPropGetter(const char* prop_name_string,
const char* class_name_string,
v8::Local<v8::String> property,
const v8::PropertyCallbackInfo<v8::Value>& info) {
- CJS_Runtime* pRuntime =
- CJS_Runtime::RuntimeFromIsolateCurrentContext(info.GetIsolate());
- if (!pRuntime)
+ CJS_Object* pJSObj = CFXJS_Engine::GetObjectPrivate(info.Holder());
+ if (!pJSObj)
return;
- CJS_Object* pJSObj = pRuntime->GetObjectPrivate(info.Holder());
- if (!pJSObj)
+ CJS_Runtime* pRuntime = pJSObj->GetRuntime();
+ if (!pRuntime)
return;
C* pObj = static_cast<C*>(pJSObj);
@@ -90,13 +89,12 @@ void JSPropSetter(const char* prop_name_string,
v8::Local<v8::String> property,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<void>& info) {
- CJS_Runtime* pRuntime =
- CJS_Runtime::RuntimeFromIsolateCurrentContext(info.GetIsolate());
- if (!pRuntime)
+ CJS_Object* pJSObj = CFXJS_Engine::GetObjectPrivate(info.Holder());
+ if (!pJSObj)
return;
- CJS_Object* pJSObj = pRuntime->GetObjectPrivate(info.Holder());
- if (!pJSObj)
+ CJS_Runtime* pRuntime = pJSObj->GetRuntime();
+ if (!pRuntime)
return;
C* pObj = static_cast<C*>(pJSObj);
@@ -113,13 +111,12 @@ template <class C,
void JSMethod(const char* method_name_string,
const char* class_name_string,
const v8::FunctionCallbackInfo<v8::Value>& info) {
- CJS_Runtime* pRuntime =
- CJS_Runtime::RuntimeFromIsolateCurrentContext(info.GetIsolate());
- if (!pRuntime)
+ CJS_Object* pJSObj = CFXJS_Engine::GetObjectPrivate(info.Holder());
+ if (!pJSObj)
return;
- CJS_Object* pJSObj = pRuntime->GetObjectPrivate(info.Holder());
- if (!pJSObj)
+ CJS_Runtime* pRuntime = pJSObj->GetRuntime();
+ if (!pRuntime)
return;
std::vector<v8::Local<v8::Value>> parameters;