Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: fpdfsdk/javascript/JS_GlobalData.h

Issue 2154843002: Clean up singleton implementation (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/fpdfxfa/include/fpdfxfa_app.h ('k') | fpdfsdk/javascript/JS_GlobalData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/javascript/JS_GlobalData.h
diff --git a/fpdfsdk/javascript/JS_GlobalData.h b/fpdfsdk/javascript/JS_GlobalData.h
index 8273c0838c0371e7923069638c2d81afa23f6786..d901ec58b37460e4f6ef289ca3d3843b595b8130 100644
--- a/fpdfsdk/javascript/JS_GlobalData.h
+++ b/fpdfsdk/javascript/JS_GlobalData.h
@@ -11,49 +11,14 @@
#include <vector>
#include "core/fxcrt/include/fx_basic.h"
+#include "fpdfsdk/javascript/JS_KeyValue.h"
-#define JS_GLOBALDATA_TYPE_NUMBER 0
-#define JS_GLOBALDATA_TYPE_BOOLEAN 1
-#define JS_GLOBALDATA_TYPE_STRING 2
-#define JS_GLOBALDATA_TYPE_OBJECT 3
-#define JS_GLOBALDATA_TYPE_NULL 4
-
-class CJS_KeyValue;
class CPDFDoc_Environment;
-class CJS_GlobalVariableArray {
- public:
- CJS_GlobalVariableArray();
- virtual ~CJS_GlobalVariableArray();
-
- void Add(CJS_KeyValue* p);
- int Count() const;
- CJS_KeyValue* GetAt(int index) const;
- void Copy(const CJS_GlobalVariableArray& array);
-
- void Empty();
-
- private:
- CFX_ArrayTemplate<CJS_KeyValue*> m_Array;
-};
-
-class CJS_KeyValue {
- public:
- CJS_KeyValue();
- virtual ~CJS_KeyValue();
-
- CFX_ByteString sKey;
- int nType; // 0:int 1:bool 2:string 3:obj
- double dData;
- bool bData;
- CFX_ByteString sData;
- CJS_GlobalVariableArray objData;
-};
-
class CJS_GlobalData_Element {
public:
CJS_GlobalData_Element() {}
- virtual ~CJS_GlobalData_Element() {}
+ ~CJS_GlobalData_Element() {}
CJS_KeyValue data;
FX_BOOL bPersistent;
@@ -84,8 +49,6 @@ class CJS_GlobalData {
using const_iterator =
std::vector<std::unique_ptr<CJS_GlobalData_Element>>::const_iterator;
- static CJS_GlobalData* g_Instance;
-
CJS_GlobalData();
~CJS_GlobalData();
« no previous file with comments | « fpdfsdk/fpdfxfa/include/fpdfxfa_app.h ('k') | fpdfsdk/javascript/JS_GlobalData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698