summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-11-20 14:23:02 -0800
committerTom Sepez <tsepez@chromium.org>2015-11-20 14:23:02 -0800
commitb8ec0a3405c6f184e4b9811870081295cae078c9 (patch)
treed2b951564b94191968a3f52427ee70c8a09de828 /fpdfsdk/src/javascript
parent3f7dc2be794e981a2728b2ae1eddf4a32179db9a (diff)
downloadpdfium-b8ec0a3405c6f184e4b9811870081295cae078c9.tar.xz
Mising JS refactoring in XFA.
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1463973002 .
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r--fpdfsdk/src/javascript/JS_Define.h27
1 files changed, 13 insertions, 14 deletions
diff --git a/fpdfsdk/src/javascript/JS_Define.h b/fpdfsdk/src/javascript/JS_Define.h
index 740295e1cb..02b36f9322 100644
--- a/fpdfsdk/src/javascript/JS_Define.h
+++ b/fpdfsdk/src/javascript/JS_Define.h
@@ -78,8 +78,8 @@ void JSPropGetter(const char* prop_name_string,
v8::Local<v8::String> property,
const v8::PropertyCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
- CJS_Runtime* pRuntime = static_cast<CJS_Runtime*>(
- FXJS_GetRuntimeFromV8Context(isolate->GetCurrentContext()));
+ CJS_Runtime* pRuntime =
+ static_cast<CJS_Runtime*>(FXJS_GetRuntimeFromIsolate(isolate));
if (!pRuntime)
return;
IJS_Context* pContext = pRuntime->GetCurrentContext();
@@ -104,8 +104,8 @@ void JSPropSetter(const char* prop_name_string,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<void>& info) {
v8::Isolate* isolate = info.GetIsolate();
- CJS_Runtime* pRuntime = static_cast<CJS_Runtime*>(
- FXJS_GetRuntimeFromV8Context(isolate->GetCurrentContext()));
+ CJS_Runtime* pRuntime =
+ static_cast<CJS_Runtime*>(FXJS_GetRuntimeFromIsolate(isolate));
if (!pRuntime)
return;
IJS_Context* pContext = pRuntime->GetCurrentContext();
@@ -143,8 +143,8 @@ void JSMethod(const char* method_name_string,
const char* class_name_string,
const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
- CJS_Runtime* pRuntime = static_cast<CJS_Runtime*>(
- FXJS_GetRuntimeFromV8Context(isolate->GetCurrentContext()));
+ CJS_Runtime* pRuntime =
+ static_cast<CJS_Runtime*>(FXJS_GetRuntimeFromIsolate(isolate));
if (!pRuntime)
return;
IJS_Context* pContext = pRuntime->GetCurrentContext();
@@ -366,8 +366,8 @@ void JSSpecialPropGet(const char* class_name,
v8::Local<v8::String> property,
const v8::PropertyCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
- CJS_Runtime* pRuntime = static_cast<CJS_Runtime*>(
- FXJS_GetRuntimeFromV8Context(isolate->GetCurrentContext()));
+ CJS_Runtime* pRuntime =
+ static_cast<CJS_Runtime*>(FXJS_GetRuntimeFromIsolate(isolate));
if (!pRuntime)
return;
IJS_Context* pContext = pRuntime->GetCurrentContext();
@@ -393,8 +393,8 @@ void JSSpecialPropPut(const char* class_name,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
- CJS_Runtime* pRuntime = static_cast<CJS_Runtime*>(
- FXJS_GetRuntimeFromV8Context(isolate->GetCurrentContext()));
+ CJS_Runtime* pRuntime =
+ static_cast<CJS_Runtime*>(FXJS_GetRuntimeFromIsolate(isolate));
if (!pRuntime)
return;
IJS_Context* pContext = pRuntime->GetCurrentContext();
@@ -417,8 +417,7 @@ void JSSpecialPropDel(const char* class_name,
v8::Local<v8::String> property,
const v8::PropertyCallbackInfo<v8::Boolean>& info) {
v8::Isolate* isolate = info.GetIsolate();
- IJS_Runtime* pRuntime =
- FXJS_GetRuntimeFromV8Context(isolate->GetCurrentContext());
+ IJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate);
if (!pRuntime)
return;
IJS_Context* pContext = pRuntime->GetCurrentContext();
@@ -442,8 +441,8 @@ template <FX_BOOL (*F)(IJS_Context*,
CFX_WideString&)>
void JSGlobalFunc(const char* func_name_string,
const v8::FunctionCallbackInfo<v8::Value>& info) {
- CJS_Runtime* pRuntime = static_cast<CJS_Runtime*>(
- FXJS_GetRuntimeFromV8Context(info.GetIsolate()->GetCurrentContext()));
+ CJS_Runtime* pRuntime =
+ static_cast<CJS_Runtime*>(FXJS_GetRuntimeFromIsolate(info.GetIsolate()));
if (!pRuntime)
return;
IJS_Context* pContext = pRuntime->GetCurrentContext();