summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfxfa/cpdfxfa_app.h
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-10-13 12:14:34 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-13 12:14:35 -0700
commita282c7380f3964de41ea93c9980b12c4513d3473 (patch)
tree5202284e527cd2bdcd7bcd22495018c9fbff1fd5 /fpdfsdk/fpdfxfa/cpdfxfa_app.h
parentf3736bca5f874b0889c5906ffbd74a405089f671 (diff)
downloadpdfium-a282c7380f3964de41ea93c9980b12c4513d3473.tar.xz
Revert of Reland: Make the CPDFXFA_App non-global (patchset #2 id:20001 of https://codereview.chromium.org/2418653003/ )
Reason for revert: https://build.chromium.org/p/client.pdfium/builders/linux_xfa_asan_lsan/builds/117/steps/corpus%20tests/logs/stdio Original issue's description: > 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 > > Committed: https://pdfium.googlesource.com/pdfium/+/f3736bca5f874b0889c5906ffbd74a405089f671 TBR=tsepez@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=pdfium:623 Review-Url: https://codereview.chromium.org/2414883006
Diffstat (limited to 'fpdfsdk/fpdfxfa/cpdfxfa_app.h')
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_app.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_app.h b/fpdfsdk/fpdfxfa/cpdfxfa_app.h
index c867df2388..78184d1434 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_app.h
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_app.h
@@ -14,13 +14,21 @@ 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(); }
- void SetFormFillEnv(CPDFSDK_FormFillEnvironment* pFormFillEnv) {
- m_pFormFillEnv = pFormFillEnv;
+ 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;
}
v8::Isolate* GetJSERuntime() const { return m_pIsolate; }
@@ -54,11 +62,12 @@ class CPDFXFA_App : public IXFA_AppProvider {
void LoadString(int32_t iStringID, CFX_WideString& wsString) override;
IFWL_AdapterTimerMgr* GetTimerMgr() override;
- private:
- CPDFSDK_FormFillEnvironment* m_pFormFillEnv; // Not owned.
+ CFX_ArrayTemplate<CPDFSDK_FormFillEnvironment*> m_pFormFillEnvList;
+
+ protected:
+ FX_BOOL m_bJavaScriptInitialized;
std::unique_ptr<CXFA_FFApp> m_pXFAApp;
v8::Isolate* m_pIsolate;
- bool m_bOwnsIsolate;
};
#endif // FPDFSDK_FPDFXFA_CPDFXFA_APP_H_