diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-09-22 08:36:17 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-09-22 08:36:17 -0700 |
commit | ed7b2b50aa1744e0bc5a60bef12c61fa91d863b7 (patch) | |
tree | 8661329f66b823af324441fb6accec98a8753cb8 /fpdfsdk/src/javascript/JS_Runtime.cpp | |
parent | 854a7f65b70d40225a53890a68a57f5c13cf268c (diff) | |
download | pdfium-ed7b2b50aa1744e0bc5a60bef12c61fa91d863b7.tar.xz |
XFA: contention between FXJSE and FXJS over isolate data slots
This probably broke at 06b60021e when the FXJS slot moved to 0
from 1 unless explicitly overriden by the embedder, which conflicted
with the FXJSE_ usage of slot 0.
Also simplify some logic used to track global intialization of the
underling JS.
TEST=run_javascript_tests.py on XFA branch doesn't segv.
R=jochen@chromium.org
Review URL: https://codereview.chromium.org/1351173002 .
Diffstat (limited to 'fpdfsdk/src/javascript/JS_Runtime.cpp')
-rw-r--r-- | fpdfsdk/src/javascript/JS_Runtime.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp index e8e48b0c07..9996653215 100644 --- a/fpdfsdk/src/javascript/JS_Runtime.cpp +++ b/fpdfsdk/src/javascript/JS_Runtime.cpp @@ -59,7 +59,7 @@ CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp) v8::Isolate::Scope isolate_scope(isolate); v8::Locker locker(isolate); v8::HandleScope handle_scope(isolate); - if (CPDFXFA_App::GetInstance()->InitRuntime(FALSE)) { + if (CPDFXFA_App::GetInstance()->IsJavaScriptInitialized()) { CJS_Context* pContext = (CJS_Context*)NewContext(); FXJS_InitializeRuntime(GetIsolate(), this, pContext, m_context); ReleaseContext(pContext); @@ -71,6 +71,7 @@ CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp) embedderDataSlot = pApp->GetFormFillInfo()->m_pJsPlatform->m_v8EmbedderSlot; FXJS_Initialize(embedderDataSlot); DefineJSObjects(); + CPDFXFA_App::GetInstance()->SetJavaScriptInitialized(TRUE); CJS_Context* pContext = (CJS_Context*)NewContext(); FXJS_InitializeRuntime(GetIsolate(), this, pContext, m_context); |