summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfxfa
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-07-20 10:35:31 -0700
committerCommit bot <commit-bot@chromium.org>2016-07-20 10:35:31 -0700
commit47228aceb86744f858ab8bfa98f3f8b62054dfae (patch)
treed5d8abbc5eaeb23b291cf604bf33c77cf648b0bb /fpdfsdk/fpdfxfa
parent31f8740fe51ceca8e973a2efe40d4d440d7a5cb7 (diff)
downloadpdfium-47228aceb86744f858ab8bfa98f3f8b62054dfae.tar.xz
Clean up singleton implementation
Move the singleton instances into their namespaces, and use get()/getInstance() for uniform accesses. Review-Url: https://codereview.chromium.org/2154843002
Diffstat (limited to 'fpdfsdk/fpdfxfa')
-rw-r--r--fpdfsdk/fpdfxfa/fpdfxfa_app.cpp6
-rw-r--r--fpdfsdk/fpdfxfa/include/fpdfxfa_app.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp b/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp
index 5774a54785..22d84f1f9f 100644
--- a/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp
+++ b/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp
@@ -13,7 +13,11 @@
#include "xfa/fxfa/include/xfa_ffapp.h"
#include "xfa/fxfa/include/xfa_fontmgr.h"
-CPDFXFA_App* CPDFXFA_App::g_pApp = nullptr;
+namespace {
+
+CPDFXFA_App* g_pApp = nullptr;
+
+} // namespace
CPDFXFA_App* CPDFXFA_App::GetInstance() {
if (!g_pApp) {
diff --git a/fpdfsdk/fpdfxfa/include/fpdfxfa_app.h b/fpdfsdk/fpdfxfa/include/fpdfxfa_app.h
index 7b96e4378f..5ebb2c2623 100644
--- a/fpdfsdk/fpdfxfa/include/fpdfxfa_app.h
+++ b/fpdfsdk/fpdfxfa/include/fpdfxfa_app.h
@@ -73,8 +73,6 @@ class CPDFXFA_App : public IXFA_AppProvider {
CFX_ArrayTemplate<CPDFDoc_Environment*> m_pEnvList;
protected:
- static CPDFXFA_App* g_pApp;
-
FX_BOOL m_bJavaScriptInitialized;
CXFA_FFApp* m_pXFAApp;
v8::Isolate* m_pIsolate;