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

Unified Diff: fpdfsdk/src/javascript/JS_Runtime.cpp

Issue 1400503003: Merge to XFA: Only call DefineJSObjects() once for the global V8 isolate. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: rebase Created 5 years, 2 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/include/jsapi/fxjs_v8.h ('k') | fpdfsdk/src/jsapi/fxjs_v8.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/javascript/JS_Runtime.cpp
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index f97b4549930835d61e49ad6694b345255d9a645b..a449a142ac8fd851df1b45a0e3ef0e7017ccd283 100644
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp
@@ -70,7 +70,9 @@ CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp)
return;
}
- DefineJSObjects();
+ if (m_isolateManaged || FXJS_GlobalIsolateRefCount() == 0)
+ DefineJSObjects();
+
CPDFXFA_App::GetInstance()->SetJavaScriptInitialized(TRUE);
CJS_Context* pContext = (CJS_Context*)NewContext();
« no previous file with comments | « fpdfsdk/include/jsapi/fxjs_v8.h ('k') | fpdfsdk/src/jsapi/fxjs_v8.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698