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

Side by Side Diff: fpdfsdk/fpdfview.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/fpdfdoc_unittest.cpp ('k') | fpdfsdk/fpdfxfa/fpdfxfa_app.cpp » ('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 "public/fpdfview.h" 7 #include "public/fpdfview.h"
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 CCodec_ModuleMgr* g_pCodecModule = nullptr; 255 CCodec_ModuleMgr* g_pCodecModule = nullptr;
256 256
257 DLLEXPORT void STDCALL FPDF_InitLibrary() { 257 DLLEXPORT void STDCALL FPDF_InitLibrary() {
258 FPDF_InitLibraryWithConfig(nullptr); 258 FPDF_InitLibraryWithConfig(nullptr);
259 } 259 }
260 260
261 DLLEXPORT void STDCALL 261 DLLEXPORT void STDCALL
262 FPDF_InitLibraryWithConfig(const FPDF_LIBRARY_CONFIG* cfg) { 262 FPDF_InitLibraryWithConfig(const FPDF_LIBRARY_CONFIG* cfg) {
263 g_pCodecModule = new CCodec_ModuleMgr(); 263 g_pCodecModule = new CCodec_ModuleMgr();
264 264
265 CFX_GEModule::Create(cfg ? cfg->m_pUserFontPaths : nullptr, g_pCodecModule); 265 CFX_GEModule* pModule = CFX_GEModule::Get();
266 CPDF_ModuleMgr::Create(); 266 pModule->Init(cfg ? cfg->m_pUserFontPaths : nullptr, g_pCodecModule);
267 CPDF_ModuleMgr* pModuleMgr = CPDF_ModuleMgr::Get(); 267 CPDF_ModuleMgr* pModuleMgr = CPDF_ModuleMgr::Get();
268 pModuleMgr->SetCodecModule(g_pCodecModule); 268 pModuleMgr->SetCodecModule(g_pCodecModule);
269 pModuleMgr->InitPageModule(); 269 pModuleMgr->InitPageModule();
270 pModuleMgr->LoadEmbeddedGB1CMaps(); 270 pModuleMgr->LoadEmbeddedGB1CMaps();
271 pModuleMgr->LoadEmbeddedJapan1CMaps(); 271 pModuleMgr->LoadEmbeddedJapan1CMaps();
272 pModuleMgr->LoadEmbeddedCNS1CMaps(); 272 pModuleMgr->LoadEmbeddedCNS1CMaps();
273 pModuleMgr->LoadEmbeddedKorea1CMaps(); 273 pModuleMgr->LoadEmbeddedKorea1CMaps();
274 274
275 #ifdef PDF_ENABLE_XFA 275 #ifdef PDF_ENABLE_XFA
276 CPDFXFA_App::GetInstance()->Initialize( 276 CPDFXFA_App::GetInstance()->Initialize(
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 if (!buffer) { 1119 if (!buffer) {
1120 *buflen = len; 1120 *buflen = len;
1121 } else if (*buflen >= len) { 1121 } else if (*buflen >= len) {
1122 memcpy(buffer, utf16Name.c_str(), len); 1122 memcpy(buffer, utf16Name.c_str(), len);
1123 *buflen = len; 1123 *buflen = len;
1124 } else { 1124 } else {
1125 *buflen = -1; 1125 *buflen = -1;
1126 } 1126 }
1127 return (FPDF_DEST)pDestObj; 1127 return (FPDF_DEST)pDestObj;
1128 } 1128 }
OLDNEW
« no previous file with comments | « fpdfsdk/fpdfdoc_unittest.cpp ('k') | fpdfsdk/fpdfxfa/fpdfxfa_app.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698