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

Side by Side Diff: fpdfsdk/fpdfxfa/fpdfxfa_app.cpp

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 unified diff | Download patch
« no previous file with comments | « fpdfsdk/fpdfview.cpp ('k') | fpdfsdk/fpdfxfa/include/fpdfxfa_app.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_app.h" 7 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_app.h"
8 8
9 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_util.h" 9 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_util.h"
10 #include "fpdfsdk/include/fsdk_define.h" 10 #include "fpdfsdk/include/fsdk_define.h"
11 #include "fpdfsdk/include/fsdk_mgr.h" 11 #include "fpdfsdk/include/fsdk_mgr.h"
12 #include "xfa/fxbarcode/include/BC_Library.h" 12 #include "xfa/fxbarcode/include/BC_Library.h"
13 #include "xfa/fxfa/include/xfa_ffapp.h" 13 #include "xfa/fxfa/include/xfa_ffapp.h"
14 #include "xfa/fxfa/include/xfa_fontmgr.h" 14 #include "xfa/fxfa/include/xfa_fontmgr.h"
15 15
16 CPDFXFA_App* CPDFXFA_App::g_pApp = nullptr; 16 namespace {
17
18 CPDFXFA_App* g_pApp = nullptr;
19
20 } // namespace
17 21
18 CPDFXFA_App* CPDFXFA_App::GetInstance() { 22 CPDFXFA_App* CPDFXFA_App::GetInstance() {
19 if (!g_pApp) { 23 if (!g_pApp) {
20 g_pApp = new CPDFXFA_App(); 24 g_pApp = new CPDFXFA_App();
21 } 25 }
22 return g_pApp; 26 return g_pApp;
23 } 27 }
24 28
25 void CPDFXFA_App::ReleaseInstance() { 29 void CPDFXFA_App::ReleaseInstance() {
26 delete g_pApp; 30 delete g_pApp;
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 } 352 }
349 } 353 }
350 354
351 IFWL_AdapterTimerMgr* CPDFXFA_App::GetTimerMgr() { 355 IFWL_AdapterTimerMgr* CPDFXFA_App::GetTimerMgr() {
352 CXFA_FWLAdapterTimerMgr* pAdapter = nullptr; 356 CXFA_FWLAdapterTimerMgr* pAdapter = nullptr;
353 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0); 357 CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0);
354 if (pEnv) 358 if (pEnv)
355 pAdapter = new CXFA_FWLAdapterTimerMgr(pEnv); 359 pAdapter = new CXFA_FWLAdapterTimerMgr(pEnv);
356 return pAdapter; 360 return pAdapter;
357 } 361 }
OLDNEW
« no previous file with comments | « fpdfsdk/fpdfview.cpp ('k') | fpdfsdk/fpdfxfa/include/fpdfxfa_app.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698