From ed7b2b50aa1744e0bc5a60bef12c61fa91d863b7 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 22 Sep 2015 08:36:17 -0700 Subject: 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 . --- fpdfsdk/include/fpdfxfa/fpdfxfa_app.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'fpdfsdk/include/fpdfxfa/fpdfxfa_app.h') diff --git a/fpdfsdk/include/fpdfxfa/fpdfxfa_app.h b/fpdfsdk/include/fpdfxfa/fpdfxfa_app.h index 49825c3f7f..f5052e3adf 100644 --- a/fpdfsdk/include/fpdfxfa/fpdfxfa_app.h +++ b/fpdfsdk/include/fpdfxfa/fpdfxfa_app.h @@ -23,9 +23,12 @@ class CPDFXFA_App : public IXFA_AppProvider { FX_BOOL AddFormFillEnv(CPDFDoc_Environment* pEnv); FX_BOOL RemoveFormFillEnv(CPDFDoc_Environment* pEnv); - FXJSE_HRUNTIME GetJSERuntime() { return m_hJSERuntime; } - void ReleaseRuntime(); - FX_BOOL InitRuntime(FX_BOOL bReset = FALSE); + FX_BOOL IsJavaScriptInitialized() const { return m_bJavaScriptInitialized; } + void SetJavaScriptInitialized(FX_BOOL bInitialized) { + m_bJavaScriptInitialized = bInitialized; + } + + FXJSE_HRUNTIME GetJSERuntime() const { return m_hJSERuntime; } // IFXA_AppProvider: void GetAppType(CFX_WideString& wsAppType) override; @@ -81,7 +84,7 @@ class CPDFXFA_App : public IXFA_AppProvider { protected: static CPDFXFA_App* g_pApp; - FX_BOOL m_bInitRuntime; + FX_BOOL m_bJavaScriptInitialized; IXFA_App* m_pXFAApp; IXFA_FontMgr* m_pFontMgr; FXJSE_HRUNTIME m_hJSERuntime; -- cgit v1.2.3