Replace calls to v8::Isolate::GetCurrent(), part 3
Fixed: pdfium:1737
Change-Id: I3b83015078ad46a733b18e54299be592d5b164a2
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/86296
Commit-Queue: Daniel Hosseinian <dhoss@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/fxjs/js_define.h b/fxjs/js_define.h
index a4314d7..17f4ed7 100644
--- a/fxjs/js_define.h
+++ b/fxjs/js_define.h
@@ -51,11 +51,11 @@
void JSDestructor(v8::Local<v8::Object> obj);
template <class C>
-UnownedPtr<C> JSGetObject(v8::Local<v8::Object> obj) {
+UnownedPtr<C> JSGetObject(v8::Isolate* isolate, v8::Local<v8::Object> obj) {
if (CFXJS_Engine::GetObjDefnID(obj) != C::GetObjDefnID())
return nullptr;
- CJS_Object* pJSObj = CFXJS_Engine::GetObjectPrivate(obj);
+ CJS_Object* pJSObj = CFXJS_Engine::GetObjectPrivate(isolate, obj);
if (!pJSObj)
return nullptr;
@@ -67,7 +67,7 @@
const char* class_name_string,
v8::Local<v8::String> property,
const v8::PropertyCallbackInfo<v8::Value>& info) {
- auto pObj = JSGetObject<C>(info.Holder());
+ auto pObj = JSGetObject<C>(info.GetIsolate(), info.Holder());
if (!pObj)
return;
@@ -92,7 +92,7 @@
v8::Local<v8::String> property,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<void>& info) {
- auto pObj = JSGetObject<C>(info.Holder());
+ auto pObj = JSGetObject<C>(info.GetIsolate(), info.Holder());
if (!pObj)
return;
@@ -113,7 +113,7 @@
void JSMethod(const char* method_name_string,
const char* class_name_string,
const v8::FunctionCallbackInfo<v8::Value>& info) {
- auto pObj = JSGetObject<C>(info.Holder());
+ auto pObj = JSGetObject<C>(info.GetIsolate(), info.Holder());
if (!pObj)
return;