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

Side by Side Diff: fpdfsdk/src/fpdfview.cpp

Issue 372473003: Remove custom memory manager (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Change malloc to calloc Created 6 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/src/fpdfoom.cpp ('k') | pdfium.gyp » ('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 "../include/fsdk_define.h" 7 #include "../include/fsdk_define.h"
8 #include "../include/fpdfview.h" 8 #include "../include/fpdfview.h"
9 #include "../include/fsdk_rendercontext.h" 9 #include "../include/fsdk_rendercontext.h"
10 #include "../include/fpdf_progressive.h" 10 #include "../include/fpdf_progressive.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 90
91 #ifndef _T 91 #ifndef _T
92 #define _T(x) x 92 #define _T(x) x
93 #endif 93 #endif
94 94
95 #ifdef API5 95 #ifdef API5
96 CPDF_ModuleMgr* g_pModuleMgr = NULL; 96 CPDF_ModuleMgr* g_pModuleMgr = NULL;
97 #else 97 #else
98 CCodec_ModuleMgr* g_pCodecModule = NULL; 98 CCodec_ModuleMgr* g_pCodecModule = NULL;
99 #ifdef _FXSDK_OPENSOURCE_
100 FXMEM_FoxitMgr* g_pFoxitMgr = NULL;
101 #endif
102 #endif 99 #endif
103 100
104 //extern CPDFSDK_FormFillApp* g_pFormFillApp; 101 //extern CPDFSDK_FormFillApp* g_pFormFillApp;
105 102
106 #if _FX_OS_ == _FX_LINUX_EMBEDDED_ 103 #if _FX_OS_ == _FX_LINUX_EMBEDDED_
107 class CFontMapper : public IPDF_FontMapper 104 class CFontMapper : public IPDF_FontMapper
108 { 105 {
109 public: 106 public:
110 CFontMapper(); 107 CFontMapper();
111 virtual ~CFontMapper(); 108 virtual ~CFontMapper();
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 #endif 151 #endif
155 #ifdef _JPX_DECODER_ 152 #ifdef _JPX_DECODER_
156 g_pModuleMgr->InitJpxModule(); 153 g_pModuleMgr->InitJpxModule();
157 g_pModuleMgr->InitJbig2Module(); 154 g_pModuleMgr->InitJbig2Module();
158 // g_pModuleMgr->InitIccModule(); 155 // g_pModuleMgr->InitIccModule();
159 #endif 156 #endif
160 #else 157 #else
161 g_pModuleMgr->InitDesktop(); 158 g_pModuleMgr->InitDesktop();
162 #endif 159 #endif
163 #else 160 #else
164 #ifdef _FXSDK_OPENSOURCE_
165 g_pFoxitMgr = FXMEM_CreateMemoryMgr(1024 * 1024 * 32, TRUE);
166 #endif
167 g_pCodecModule = CCodec_ModuleMgr::Create(); 161 g_pCodecModule = CCodec_ModuleMgr::Create();
168 162
169 CFX_GEModule::Create(); 163 CFX_GEModule::Create();
170 CFX_GEModule::Get()->SetCodecModule(g_pCodecModule); 164 CFX_GEModule::Get()->SetCodecModule(g_pCodecModule);
171 165
172 CPDF_ModuleMgr::Create(); 166 CPDF_ModuleMgr::Create();
173 CPDF_ModuleMgr::Get()->SetCodecModule(g_pCodecModule); 167 CPDF_ModuleMgr::Get()->SetCodecModule(g_pCodecModule);
174 CPDF_ModuleMgr::Get()->InitPageModule(); 168 CPDF_ModuleMgr::Get()->InitPageModule();
175 CPDF_ModuleMgr::Get()->InitRenderModule(); 169 CPDF_ModuleMgr::Get()->InitRenderModule();
176 #ifdef FOXIT_CHROME_BUILD 170 #ifdef FOXIT_CHROME_BUILD
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 #ifdef API5 212 #ifdef API5
219 g_pModuleMgr->Destroy(); 213 g_pModuleMgr->Destroy();
220 #else 214 #else
221 CPDF_ModuleMgr::Destroy(); 215 CPDF_ModuleMgr::Destroy();
222 CFX_GEModule::Destroy(); 216 CFX_GEModule::Destroy();
223 g_pCodecModule->Destroy(); 217 g_pCodecModule->Destroy();
224 #endif 218 #endif
225 #ifndef _FXSDK_OPENSOURCE_ 219 #ifndef _FXSDK_OPENSOURCE_
226 FXMEM_CollectAll(FXMEM_GetDefaultMgr()); 220 FXMEM_CollectAll(FXMEM_GetDefaultMgr());
227 #else 221 #else
228 » FXMEM_DestroyFoxitMgr(g_pFoxitMgr); 222
229 #endif 223 #endif
230 } 224 }
231 225
232 #ifndef _WIN32 226 #ifndef _WIN32
233 int g_LastError; 227 int g_LastError;
234 void SetLastError(int err) 228 void SetLastError(int err)
235 { 229 {
236 g_LastError = err; 230 g_LastError = err;
237 } 231 }
238 232
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 { 864 {
871 if (document == NULL) 865 if (document == NULL)
872 return NULL; 866 return NULL;
873 if (name == NULL || name[0] == 0) 867 if (name == NULL || name[0] == 0)
874 return NULL; 868 return NULL;
875 869
876 CPDF_Document* pDoc = (CPDF_Document*)document; 870 CPDF_Document* pDoc = (CPDF_Document*)document;
877 CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests")); 871 CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests"));
878 return name_tree.LookupNamedDest(pDoc, name); 872 return name_tree.LookupNamedDest(pDoc, name);
879 } 873 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fpdfoom.cpp ('k') | pdfium.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698