diff options
author | dsinclair <dsinclair@chromium.org> | 2016-10-13 12:07:42 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-13 12:07:42 -0700 |
commit | f3736bca5f874b0889c5906ffbd74a405089f671 (patch) | |
tree | ef3a3731f4dfd6b5e3e7f957b1d8e1b61a1a1804 /fpdfsdk/fpdfxfa/cpdfxfa_app.h | |
parent | 271d9c0a85b50208baa8789ba6b245956317f719 (diff) | |
download | pdfium-f3736bca5f874b0889c5906ffbd74a405089f671.tar.xz |
Reland: Make the CPDFXFA_App non-global
This reverts commit b685e6471075bebd26711bc183de3128f54932e3.
This CL changes CPDFXFA_App from a global object to a child of the CPDFXFA_Document objects.
BUG=pdfium:623
Review-Url: https://codereview.chromium.org/2418653003
Diffstat (limited to 'fpdfsdk/fpdfxfa/cpdfxfa_app.h')
-rw-r--r-- | fpdfsdk/fpdfxfa/cpdfxfa_app.h | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_app.h b/fpdfsdk/fpdfxfa/cpdfxfa_app.h index 78184d1434..c867df2388 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_app.h +++ b/fpdfsdk/fpdfxfa/cpdfxfa_app.h @@ -14,21 +14,13 @@ class IFXJS_Runtime; class CPDFXFA_App : public IXFA_AppProvider { public: - static CPDFXFA_App* GetInstance(); - static void ReleaseInstance(); - CPDFXFA_App(); ~CPDFXFA_App() override; - FX_BOOL Initialize(v8::Isolate* pIsolate); CXFA_FFApp* GetXFAApp() { return m_pXFAApp.get(); } - FX_BOOL AddFormFillEnv(CPDFSDK_FormFillEnvironment* pFormFillEnv); - FX_BOOL RemoveFormFillEnv(CPDFSDK_FormFillEnvironment* pFormFillEnv); - - FX_BOOL IsJavaScriptInitialized() const { return m_bJavaScriptInitialized; } - void SetJavaScriptInitialized(FX_BOOL bInitialized) { - m_bJavaScriptInitialized = bInitialized; + void SetFormFillEnv(CPDFSDK_FormFillEnvironment* pFormFillEnv) { + m_pFormFillEnv = pFormFillEnv; } v8::Isolate* GetJSERuntime() const { return m_pIsolate; } @@ -62,12 +54,11 @@ class CPDFXFA_App : public IXFA_AppProvider { void LoadString(int32_t iStringID, CFX_WideString& wsString) override; IFWL_AdapterTimerMgr* GetTimerMgr() override; - CFX_ArrayTemplate<CPDFSDK_FormFillEnvironment*> m_pFormFillEnvList; - - protected: - FX_BOOL m_bJavaScriptInitialized; + private: + CPDFSDK_FormFillEnvironment* m_pFormFillEnv; // Not owned. std::unique_ptr<CXFA_FFApp> m_pXFAApp; v8::Isolate* m_pIsolate; + bool m_bOwnsIsolate; }; #endif // FPDFSDK_FPDFXFA_CPDFXFA_APP_H_ |