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>
diff --git a/fxjs/js_define.h b/fxjs/js_define.h
index 325642d..93dfd49 100644
--- a/fxjs/js_define.h
+++ b/fxjs/js_define.h
@@ -63,13 +63,12 @@
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 @@
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 @@
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;