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/Document.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/Document.cpp')
-rw-r--r-- | fpdfsdk/src/javascript/Document.cpp | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp index 1e8d4fde8f..f25e8e0dec 100644 --- a/fpdfsdk/src/javascript/Document.cpp +++ b/fpdfsdk/src/javascript/Document.cpp @@ -260,11 +260,6 @@ FX_BOOL Document::pageNum(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::ParserParams(JSObject* pObj, CJS_AnnotObj& annotobj) { - // Not supported. - return TRUE; -} - FX_BOOL Document::addAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, @@ -330,8 +325,9 @@ FX_BOOL Document::getField(IFXJS_Context* cc, } CJS_Runtime* pRuntime = pContext->GetJSRuntime(); - JSFXObject pFieldObj = JS_NewFxDynamicObj( - *pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Field")); + v8::Local<v8::Object> pFieldObj = + JS_NewFxDynamicObj(pRuntime->GetIsolate(), pContext, + JS_GetObjDefnID(pRuntime->GetIsolate(), L"Field")); v8::Isolate* isolate = GetIsolate(cc); CJS_Field* pJSField = (CJS_Field*)JS_GetPrivate(isolate, pFieldObj); @@ -462,10 +458,10 @@ FX_BOOL Document::print(IFXJS_Context* cc, int nlength = params.size(); if (nlength == 9) { if (params[8].GetType() == VT_fxobject) { - JSFXObject pObj = params[8].ToV8Object(); + v8::Local<v8::Object> pObj = params[8].ToV8Object(); { if (JS_GetObjDefnID(pObj) == - JS_GetObjDefnID(*pRuntime, L"PrintParamsObj")) { + JS_GetObjDefnID(pRuntime->GetIsolate(), L"PrintParamsObj")) { if (CJS_Object* pJSObj = params[8].ToCJSObject()) { if (PrintParamsObj* pprintparamsObj = (PrintParamsObj*)pJSObj->GetEmbedObject()) { @@ -664,7 +660,7 @@ FX_BOOL Document::submitForm(IFXJS_Context* cc, if (nSize > 3) aFields.Attach(params[3].ToV8Array()); } else if (v.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"cURL"); if (!pValue.IsEmpty()) strURL = @@ -771,7 +767,7 @@ FX_BOOL Document::mailDoc(IFXJS_Context* cc, v8::Isolate* isolate = GetIsolate(cc); if (params.size() >= 1 && 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)).ToInt(); @@ -856,9 +852,8 @@ FX_BOOL Document::info(IFXJS_Context* cc, if (vp.IsGetting()) { CJS_Context* pContext = (CJS_Context*)cc; CJS_Runtime* pRuntime = pContext->GetJSRuntime(); - - JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, -1); - + v8::Local<v8::Object> pObj = + JS_NewFxDynamicObj(pRuntime->GetIsolate(), pContext, -1); JS_PutObjectString(isolate, pObj, L"Author", cwAuthor.c_str()); JS_PutObjectString(isolate, pObj, L"Title", cwTitle.c_str()); JS_PutObjectString(isolate, pObj, L"Subject", cwSubject.c_str()); @@ -1414,10 +1409,11 @@ FX_BOOL Document::addIcon(IFXJS_Context* cc, sError = JSGetStringFromID(pContext, IDS_STRING_JSTYPEERROR); return FALSE; } - JSFXObject pJSIcon = params[1].ToV8Object(); + v8::Local<v8::Object> pJSIcon = params[1].ToV8Object(); CJS_Runtime* pRuntime = pContext->GetJSRuntime(); - if (JS_GetObjDefnID(pJSIcon) != JS_GetObjDefnID(*pRuntime, L"Icon")) { + if (JS_GetObjDefnID(pJSIcon) != + JS_GetObjDefnID(pRuntime->GetIsolate(), L"Icon")) { sError = JSGetStringFromID(pContext, IDS_STRING_JSTYPEERROR); return FALSE; } @@ -1464,8 +1460,9 @@ FX_BOOL Document::icons(IFXJS_Context* cc, for (int i = 0; i < iIconTreeLength; i++) { pIconElement = (*m_pIconTree)[i]; - JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, - JS_GetObjDefnID(*pRuntime, L"Icon")); + v8::Local<v8::Object> pObj = + JS_NewFxDynamicObj(pRuntime->GetIsolate(), pContext, + JS_GetObjDefnID(pRuntime->GetIsolate(), L"Icon")); if (pObj.IsEmpty()) return FALSE; @@ -1507,8 +1504,9 @@ FX_BOOL Document::getIcon(IFXJS_Context* cc, if ((*m_pIconTree)[i]->IconName == swIconName) { Icon* pRetIcon = (*m_pIconTree)[i]->IconStream; - JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, - JS_GetObjDefnID(*pRuntime, L"Icon")); + v8::Local<v8::Object> pObj = + JS_NewFxDynamicObj(pRuntime->GetIsolate(), pContext, + JS_GetObjDefnID(pRuntime->GetIsolate(), L"Icon")); if (pObj.IsEmpty()) return FALSE; @@ -1708,8 +1706,9 @@ FX_BOOL Document::getPrintParams(IFXJS_Context* cc, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; CJS_Runtime* pRuntime = pContext->GetJSRuntime(); - JSFXObject pRetObj = JS_NewFxDynamicObj( - *pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"PrintParamsObj")); + v8::Local<v8::Object> pRetObj = JS_NewFxDynamicObj( + pRuntime->GetIsolate(), pContext, + JS_GetObjDefnID(pRuntime->GetIsolate(), L"PrintParamsObj")); // Not implemented yet. @@ -1832,7 +1831,7 @@ FX_BOOL Document::deletePages(IFXJS_Context* cc, if (iSize < 1) { } else 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"nStart"); nStart = CJS_Value(m_isolate, pValue, GET_VALUE_TYPE(pValue)).ToInt(); |