diff options
author | Lei Zhang <thestig@chromium.org> | 2018-07-12 13:15:11 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-07-12 13:15:11 +0000 |
commit | 6aa2190f70a80b70af7bcfe198041756ed8c803e (patch) | |
tree | cf8a69fe25e292b6330b65e9a5c46cbd978e083a | |
parent | 5ff09fb5ee9079ad7983c873525b87065eab1deb (diff) | |
download | pdfium-6aa2190f70a80b70af7bcfe198041756ed8c803e.tar.xz |
Use JSGetObject() in even more places.
BUG=chromium:862059
Change-Id: Id354a5e6dbc037dbb76f901de8311a4f4a4d8940
Reviewed-on: https://pdfium-review.googlesource.com/37670
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
-rw-r--r-- | fxjs/cjs_global.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/fxjs/cjs_global.cpp b/fxjs/cjs_global.cpp index e3c347ef58..c9afdcb8b8 100644 --- a/fxjs/cjs_global.cpp +++ b/fxjs/cjs_global.cpp @@ -32,16 +32,16 @@ template <class Alt> void JSSpecialPropQuery(const char*, v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Integer>& info) { - CJS_Object* pJSObj = CFXJS_Engine::GetObjectPrivate(info.Holder()); - if (!pJSObj) + Alt* pObj = JSGetObject<Alt>(info.Holder()); + if (!pObj) return; - CJS_Runtime* pRuntime = pJSObj->GetRuntime(); + CJS_Runtime* pRuntime = pObj->GetRuntime(); if (!pRuntime) return; - CJS_Return result = static_cast<Alt*>(pJSObj)->QueryProperty( - PropFromV8Prop(info.GetIsolate(), property).c_str()); + CJS_Return result = + pObj->QueryProperty(PropFromV8Prop(info.GetIsolate(), property).c_str()); info.GetReturnValue().Set(!result.HasError() ? 4 : 0); } @@ -50,15 +50,15 @@ template <class Alt> void JSSpecialPropGet(const char* class_name, v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info) { - CJS_Object* pJSObj = CFXJS_Engine::GetObjectPrivate(info.Holder()); - if (!pJSObj) + Alt* pObj = JSGetObject<Alt>(info.Holder()); + if (!pObj) return; - CJS_Runtime* pRuntime = pJSObj->GetRuntime(); + CJS_Runtime* pRuntime = pObj->GetRuntime(); if (!pRuntime) return; - CJS_Return result = static_cast<Alt*>(pJSObj)->GetProperty( + CJS_Return result = pObj->GetProperty( pRuntime, PropFromV8Prop(info.GetIsolate(), property).c_str()); if (result.HasError()) { @@ -75,15 +75,15 @@ void JSSpecialPropPut(const char* class_name, v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info) { - CJS_Object* pJSObj = CFXJS_Engine::GetObjectPrivate(info.Holder()); - if (!pJSObj) + Alt* pObj = JSGetObject<Alt>(info.Holder()); + if (!pObj) return; - CJS_Runtime* pRuntime = pJSObj->GetRuntime(); + CJS_Runtime* pRuntime = pObj->GetRuntime(); if (!pRuntime) return; - CJS_Return result = static_cast<Alt*>(pJSObj)->SetProperty( + CJS_Return result = pObj->SetProperty( pRuntime, PropFromV8Prop(info.GetIsolate(), property).c_str(), value); if (result.HasError()) { @@ -96,15 +96,15 @@ template <class Alt> void JSSpecialPropDel(const char* class_name, v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Boolean>& info) { - CJS_Object* pJSObj = CFXJS_Engine::GetObjectPrivate(info.Holder()); - if (!pJSObj) + Alt* pObj = JSGetObject<Alt>(info.Holder()); + if (!pObj) return; - CJS_Runtime* pRuntime = pJSObj->GetRuntime(); + CJS_Runtime* pRuntime = pObj->GetRuntime(); if (!pRuntime) return; - CJS_Return result = static_cast<Alt*>(pJSObj)->DelProperty( + CJS_Return result = pObj->DelProperty( pRuntime, PropFromV8Prop(info.GetIsolate(), property).c_str()); if (result.HasError()) { // TODO(dsinclair): Should this set the pRuntime->Error result? |