Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: fpdfsdk/javascript/app.cpp

Issue 2217253002: Remove backpointer to runtime from CJS_Array. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Remove non-const refs Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/javascript/PublicMethods.cpp ('k') | fpdfsdk/javascript/color.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/javascript/app.cpp
diff --git a/fpdfsdk/javascript/app.cpp b/fpdfsdk/javascript/app.cpp
index 329b625545d0aff23d8c8348c6f96e1fccbb0a70..673852039057ce2414fa293f4182817b41986cba 100644
--- a/fpdfsdk/javascript/app.cpp
+++ b/fpdfsdk/javascript/app.cpp
@@ -109,7 +109,7 @@ FX_BOOL app::activeDocs(IJS_Context* cc,
CPDFDoc_Environment* pApp = pContext->GetReaderApp();
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
CPDFSDK_Document* pCurDoc = pContext->GetReaderDocument();
- CJS_Array aDocs(pRuntime);
+ CJS_Array aDocs;
if (CPDFSDK_Document* pDoc = pApp->GetSDKDocument()) {
CJS_Document* pJSDocument = nullptr;
if (pDoc == pCurDoc) {
@@ -124,7 +124,8 @@ FX_BOOL app::activeDocs(IJS_Context* cc,
(CJS_Document*)FXJS_GetPrivate(pRuntime->GetIsolate(), pObj);
ASSERT(pJSDocument);
}
- aDocs.SetElement(0, CJS_Value(pRuntime, pJSDocument));
+ aDocs.SetElement(pRuntime->GetIsolate(), 0,
+ CJS_Value(pRuntime, pJSDocument));
}
if (aDocs.GetLength() > 0)
vp << aDocs;
@@ -144,8 +145,6 @@ FX_BOOL app::calculate(IJS_Context* cc,
CJS_Context* pContext = (CJS_Context*)cc;
CPDFDoc_Environment* pApp = pContext->GetReaderApp();
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- CJS_Array aDocs(pRuntime);
if (CPDFSDK_Document* pDoc = pApp->GetSDKDocument())
pDoc->GetInterForm()->EnableCalculate((FX_BOOL)m_bCalculate);
} else {
@@ -284,14 +283,14 @@ FX_BOOL app::alert(IJS_Context* cc,
CFX_WideString swMsg;
if (newParams[0].GetType() == CJS_Value::VT_object) {
- CJS_Array carray(pRuntime);
+ CJS_Array carray;
if (newParams[0].ConvertToArray(carray)) {
swMsg = L"[";
CJS_Value element(pRuntime);
for (int i = 0; i < carray.GetLength(); ++i) {
if (i)
swMsg += L", ";
- carray.GetElement(i, element);
+ carray.GetElement(pRuntime->GetIsolate(), i, element);
swMsg += element.ToCFXWideString();
}
swMsg += L"]";
« no previous file with comments | « fpdfsdk/javascript/PublicMethods.cpp ('k') | fpdfsdk/javascript/color.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698