diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-09-10 12:28:37 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-09-10 12:28:37 -0700 |
commit | 808a99e8c6f72713ca9492508faa4b8445ae0d33 (patch) | |
tree | b171af528eac6ff284bcb257418f49c031f640cd /fpdfsdk/src/javascript/app.cpp | |
parent | ab54bc0f66ca3130ea4780580060f75f20c12234 (diff) | |
download | pdfium-808a99e8c6f72713ca9492508faa4b8445ae0d33.tar.xz |
Merge to XFA: Remove some abstractions in fxjs_v8.h.
Conflicts:
fpdfsdk/src/javascript/Document.cpp
fpdfsdk/src/javascript/JS_Runtime.cpp
fpdfsdk/src/jsapi/fxjs_v8.cpp
New:
fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp
(cherry picked from commit 6df59849472958e7de96da6d9fc7b223b7c1f1c3)
Original Review URL: https://codereview.chromium.org/1332973002 .
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1334833003 .
Diffstat (limited to 'fpdfsdk/src/javascript/app.cpp')
-rw-r--r-- | fpdfsdk/src/javascript/app.cpp | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/fpdfsdk/src/javascript/app.cpp b/fpdfsdk/src/javascript/app.cpp index 4815e4729c..d81b226f96 100644 --- a/fpdfsdk/src/javascript/app.cpp +++ b/fpdfsdk/src/javascript/app.cpp @@ -122,13 +122,15 @@ FX_BOOL app::activeDocs(IFXJS_Context* cc, if (CPDFSDK_Document* pDoc = pApp->GetSDKDocument()) { CJS_Document* pJSDocument = NULL; if (pDoc == pCurDoc) { - JSFXObject pObj = JS_GetThisObj(*pRuntime); - if (JS_GetObjDefnID(pObj) == JS_GetObjDefnID(*pRuntime, L"Document")) + v8::Local<v8::Object> pObj = JS_GetThisObj(pRuntime->GetIsolate()); + if (JS_GetObjDefnID(pObj) == + JS_GetObjDefnID(pRuntime->GetIsolate(), L"Document")) pJSDocument = (CJS_Document*)JS_GetPrivate(pRuntime->GetIsolate(), pObj); } else { - JSFXObject pObj = JS_NewFxDynamicObj( - *pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Document")); + v8::Local<v8::Object> pObj = JS_NewFxDynamicObj( + pRuntime->GetIsolate(), pContext, + JS_GetObjDefnID(pRuntime->GetIsolate(), L"Document")); pJSDocument = (CJS_Document*)JS_GetPrivate(pRuntime->GetIsolate(), pObj); ASSERT(pJSDocument != NULL); } @@ -274,7 +276,7 @@ FX_BOOL app::alert(IFXJS_Context* cc, if (iSize == 1) { if (params[0].GetType() == VT_object) { - JSObject pObj = params[0].ToV8Object(); + v8::Local<v8::Object> pObj = params[0].ToV8Object(); { v8::Local<v8::Value> pValue = JS_GetObjectElement(isolate, pObj, L"cMsg"); @@ -419,8 +421,9 @@ FX_BOOL app::setInterval(IFXJS_Context* cc, // pTimer->SetStartTime(GetTickCount()); pTimer->SetJSTimer(dwInterval); - JSFXObject pRetObj = JS_NewFxDynamicObj( - *pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"TimerObj")); + v8::Local<v8::Object> pRetObj = + JS_NewFxDynamicObj(pRuntime->GetIsolate(), pContext, + JS_GetObjDefnID(pRuntime->GetIsolate(), L"TimerObj")); CJS_TimerObj* pJS_TimerObj = (CJS_TimerObj*)JS_GetPrivate(pRuntime->GetIsolate(), pRetObj); @@ -471,8 +474,9 @@ FX_BOOL app::setTimeOut(IFXJS_Context* cc, pTimer->SetTimeOut(dwTimeOut); pTimer->SetJSTimer(dwTimeOut); - JSFXObject pRetObj = JS_NewFxDynamicObj( - *pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"TimerObj")); + v8::Local<v8::Object> pRetObj = + JS_NewFxDynamicObj(pRuntime->GetIsolate(), pContext, + JS_GetObjDefnID(pRuntime->GetIsolate(), L"TimerObj")); CJS_TimerObj* pJS_TimerObj = (CJS_TimerObj*)JS_GetPrivate(pRuntime->GetIsolate(), pRetObj); @@ -503,9 +507,10 @@ FX_BOOL app::clearTimeOut(IFXJS_Context* cc, } if (params[0].GetType() == VT_fxobject) { - JSFXObject pObj = params[0].ToV8Object(); + v8::Local<v8::Object> pObj = params[0].ToV8Object(); { - if (JS_GetObjDefnID(pObj) == JS_GetObjDefnID(*pRuntime, L"TimerObj")) { + if (JS_GetObjDefnID(pObj) == + JS_GetObjDefnID(pRuntime->GetIsolate(), L"TimerObj")) { if (CJS_Object* pJSObj = params[0].ToCJSObject()) { if (TimerObj* pTimerObj = (TimerObj*)pJSObj->GetEmbedObject()) { if (CJS_Timer* pTimer = pTimerObj->GetTimer()) { @@ -545,9 +550,10 @@ FX_BOOL app::clearInterval(IFXJS_Context* cc, } if (params[0].GetType() == VT_fxobject) { - JSFXObject pObj = params[0].ToV8Object(); + v8::Local<v8::Object> pObj = params[0].ToV8Object(); { - if (JS_GetObjDefnID(pObj) == JS_GetObjDefnID(*pRuntime, L"TimerObj")) { + if (JS_GetObjDefnID(pObj) == + JS_GetObjDefnID(pRuntime->GetIsolate(), L"TimerObj")) { if (CJS_Object* pJSObj = params[0].ToCJSObject()) { if (TimerObj* pTimerObj = (TimerObj*)pJSObj->GetEmbedObject()) { if (CJS_Timer* pTimer = pTimerObj->GetTimer()) { @@ -642,7 +648,7 @@ FX_BOOL app::mailMsg(IFXJS_Context* cc, return FALSE; if (params[0].GetType() == VT_object) { - JSObject pObj = params[0].ToV8Object(); + v8::Local<v8::Object> pObj = params[0].ToV8Object(); v8::Local<v8::Value> pValue = JS_GetObjectElement(isolate, pObj, L"bUI"); bUI = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToBool(); @@ -780,7 +786,7 @@ FX_BOOL app::response(IFXJS_Context* cc, int iLength = params.size(); if (iLength > 0 && params[0].GetType() == VT_object) { - JSObject pObj = params[0].ToV8Object(); + v8::Local<v8::Object> pObj = params[0].ToV8Object(); v8::Local<v8::Value> pValue = JS_GetObjectElement(isolate, pObj, L"cQuestion"); swQuestion = |