From 6df59849472958e7de96da6d9fc7b223b7c1f1c3 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 10 Sep 2015 11:56:37 -0700 Subject: Remove some abstractions in fxjs_v8.h. It's too hard to keep mapping between v8 and fx abstractions; the lack of transparency prevents those skilled in v8 only from working on this code. Apparently, the original intention was to confine v8 types to fpdfsdk/{include,src}/jsapi, but fpdfsdk/{include,src}/javascript is already well-polluted with v8 types. Also remove no-op JS_SetThisObj(). Also remove unused ParserParams() [noticed because it was incorrectly passing handles as pointers]. Also remove cast operator from CJS_Runtime and call GetIsolate() explicitly. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1332973002 . --- fpdfsdk/src/javascript/Field.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'fpdfsdk/src/javascript/Field.cpp') diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp index c44636872b..a0570cb56c 100644 --- a/fpdfsdk/src/javascript/Field.cpp +++ b/fpdfsdk/src/javascript/Field.cpp @@ -3315,8 +3315,9 @@ FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc, CJS_Runtime* pRuntime = pContext->GetJSRuntime(); ASSERT(pRuntime != NULL); - JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, - JS_GetObjDefnID(*pRuntime, L"Icon")); + v8::Local pObj = + JS_NewFxDynamicObj(pRuntime->GetIsolate(), pContext, + JS_GetObjDefnID(pRuntime->GetIsolate(), L"Icon")); ASSERT(pObj.IsEmpty() == FALSE); CJS_Icon* pJS_Icon = (CJS_Icon*)JS_GetPrivate(pObj); @@ -3530,8 +3531,9 @@ FX_BOOL Field::getArray(IFXJS_Context* cc, for (int j = 0, jsz = swSort.GetSize(); j < jsz; j++) { CFX_WideString* pStr = swSort.GetAt(j); - JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, - JS_GetObjDefnID(*pRuntime, L"Field")); + v8::Local pObj = + JS_NewFxDynamicObj(pRuntime->GetIsolate(), pContext, + JS_GetObjDefnID(pRuntime->GetIsolate(), L"Field")); ASSERT(pObj.IsEmpty() == FALSE); CJS_Field* pJSField = (CJS_Field*)JS_GetPrivate(pObj); -- cgit v1.2.3