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

Unified Diff: fpdfsdk/javascript/JS_GlobalData.cpp

Issue 2154843002: Clean up singleton implementation (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 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
« fpdfsdk/javascript/JS_GlobalData.h ('K') | « fpdfsdk/javascript/JS_GlobalData.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/javascript/JS_GlobalData.cpp
diff --git a/fpdfsdk/javascript/JS_GlobalData.cpp b/fpdfsdk/javascript/JS_GlobalData.cpp
index 14c36530d5d65c2d2483596f16de47b514ce8bf8..fb470a02ebf1f74122dc47e963ce5880f08fbf35 100644
--- a/fpdfsdk/javascript/JS_GlobalData.cpp
+++ b/fpdfsdk/javascript/JS_GlobalData.cpp
@@ -100,21 +100,21 @@ static bool TrimPropName(CFX_ByteString* sPropName) {
return sPropName->GetLength() != 0;
}
-CJS_GlobalData* CJS_GlobalData::g_Instance = nullptr;
+CJS_GlobalData* CJS_GlobalData::m_pInstance = nullptr;
// static
CJS_GlobalData* CJS_GlobalData::GetRetainedInstance(CPDFDoc_Environment* pApp) {
- if (!g_Instance) {
- g_Instance = new CJS_GlobalData();
+ if (!m_pInstance) {
+ m_pInstance = new CJS_GlobalData();
}
- ++g_Instance->m_RefCount;
- return g_Instance;
+ ++m_pInstance->m_RefCount;
+ return m_pInstance;
}
void CJS_GlobalData::Release() {
if (!--m_RefCount) {
- delete g_Instance;
- g_Instance = nullptr;
+ delete m_pInstance;
+ m_pInstance = nullptr;
}
}
« fpdfsdk/javascript/JS_GlobalData.h ('K') | « fpdfsdk/javascript/JS_GlobalData.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698