summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/Field.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-10-13 15:00:10 -0700
committerTom Sepez <tsepez@chromium.org>2015-10-13 15:00:10 -0700
commit3342090d65e852f3f37a8f04d3fbe3ff2467d05c (patch)
tree04ea6a1adeae79279a4d4e0f147161c2b4601dcb /fpdfsdk/src/javascript/Field.cpp
parentf6c67325ebb931ecad6c0f0e90302d854db75900 (diff)
downloadpdfium-3342090d65e852f3f37a8f04d3fbe3ff2467d05c.tar.xz
Merge to XFA: Pass IJS_Runtime, not IJS_Context, to native object constructors.
Original Review URL: https://codereview.chromium.org/1389163007 . (cherry picked from commit 848a13b6777cbff8cc4aea3ab3d69eaa0b82ae6c) Merge conflics in: fpdfsdk/src/javascript/JS_Runtime.cpp fpdfsdk/src/javascript/JS_Runtime_Stub.cpp fpdfsdk/src/jsapi/fxjs_v8.cpp R=thestig@chromium.org Review URL: https://codereview.chromium.org/1394993006 .
Diffstat (limited to 'fpdfsdk/src/javascript/Field.cpp')
-rw-r--r--fpdfsdk/src/javascript/Field.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp
index f04c379d34..f3d12b479a 100644
--- a/fpdfsdk/src/javascript/Field.cpp
+++ b/fpdfsdk/src/javascript/Field.cpp
@@ -110,16 +110,10 @@ END_JS_STATIC_METHOD()
IMPLEMENT_JS_CLASS(CJS_Field, Field)
-FX_BOOL CJS_Field::InitInstance(IJS_Context* cc) {
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
-
- Field* pField = (Field*)GetEmbedObject();
- ASSERT(pField != NULL);
-
- pField->SetIsolate(pContext->GetJSRuntime()->GetIsolate());
-
- return TRUE;
+void CJS_Field::InitInstance(IJS_Runtime* pIRuntime) {
+ CJS_Runtime* pRuntime = static_cast<CJS_Runtime*>(pIRuntime);
+ Field* pField = static_cast<Field*>(GetEmbedObject());
+ pField->SetIsolate(pRuntime->GetIsolate());
};
Field::Field(CJS_Object* pJSObject)
@@ -3279,7 +3273,7 @@ FX_BOOL Field::buttonGetIcon(IJS_Context* cc,
CJS_Context* pContext = (CJS_Context*)cc;
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
v8::Local<v8::Object> pObj = FXJS_NewFxDynamicObj(
- pRuntime->GetIsolate(), pContext, CJS_Icon::g_nObjDefnID);
+ pRuntime->GetIsolate(), pRuntime, CJS_Icon::g_nObjDefnID);
ASSERT(pObj.IsEmpty() == FALSE);
CJS_Icon* pJS_Icon = (CJS_Icon*)FXJS_GetPrivate(pRuntime->GetIsolate(), pObj);
@@ -3488,7 +3482,7 @@ FX_BOOL Field::getArray(IJS_Context* cc,
for (int j = 0, jsz = swSort.GetSize(); j < jsz; j++) {
nonstd::unique_ptr<CFX_WideString> pStr(swSort.GetAt(j));
v8::Local<v8::Object> pObj = FXJS_NewFxDynamicObj(
- pRuntime->GetIsolate(), pContext, CJS_Field::g_nObjDefnID);
+ pRuntime->GetIsolate(), pRuntime, CJS_Field::g_nObjDefnID);
ASSERT(!pObj.IsEmpty());
CJS_Field* pJSField =