summaryrefslogtreecommitdiff
path: root/fpdfsdk/include/javascript/JS_GlobalData.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-09-14 15:06:53 -0700
committerTom Sepez <tsepez@chromium.org>2015-09-14 15:06:53 -0700
commitf458362c167f29f37301f48b08eb8d916e69d40b (patch)
treed1d53eb4e1fddee030d7ccbc05e19c80765260c3 /fpdfsdk/include/javascript/JS_GlobalData.h
parent142165e2f62b8ba727e8aab40591ca3a7b6fa214 (diff)
downloadpdfium-f458362c167f29f37301f48b08eb8d916e69d40b.tar.xz
Merge to XFA: Get CJS_RuntimeFactory out of CJS_GlobalData management.
(cherry picked from commit 9a817f092e6800e9338b41acf4ea0416b6ad4467) Original Review URL: https://codereview.chromium.org/1338993005 . Small manual merge in fpdfsdk/src/javascript/JS_GlobalData.cpp fpdfsdk/src/javascript/global.cpp TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1341913002 .
Diffstat (limited to 'fpdfsdk/include/javascript/JS_GlobalData.h')
-rw-r--r--fpdfsdk/include/javascript/JS_GlobalData.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/fpdfsdk/include/javascript/JS_GlobalData.h b/fpdfsdk/include/javascript/JS_GlobalData.h
index 46b94a4dda..644e0d80fc 100644
--- a/fpdfsdk/include/javascript/JS_GlobalData.h
+++ b/fpdfsdk/include/javascript/JS_GlobalData.h
@@ -58,10 +58,9 @@ class CJS_GlobalData_Element {
class CJS_GlobalData {
public:
- CJS_GlobalData(CPDFDoc_Environment* pApp);
- virtual ~CJS_GlobalData();
+ static CJS_GlobalData* GetRetainedInstance(CPDFDoc_Environment* pApp);
+ void Release();
- public:
void SetGlobalVariableNumber(const FX_CHAR* propname, double dData);
void SetGlobalVariableBoolean(const FX_CHAR* propname, bool bData);
void SetGlobalVariableString(const FX_CHAR* propname,
@@ -78,6 +77,11 @@ class CJS_GlobalData {
CJS_GlobalData_Element* GetAt(int index) const;
private:
+ static CJS_GlobalData* g_Instance;
+
+ CJS_GlobalData(CPDFDoc_Environment* pApp);
+ ~CJS_GlobalData();
+
void LoadGlobalPersistentVariables();
void SaveGlobalPersisitentVariables();
@@ -95,6 +99,7 @@ class CJS_GlobalData {
CFX_BinaryBuf& sData);
private:
+ size_t m_RefCount;
CFX_ArrayTemplate<CJS_GlobalData_Element*> m_arrayGlobalData;
CFX_WideString m_sFilePath;
CPDFDoc_Environment* m_pApp;