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

Side by Side Diff: core/fpdfapi/cpdf_modulemgr.h

Issue 2543833002: Protect against unexpected library create/destroy (Closed)
Patch Set: Add unittest Created 4 years 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 | « BUILD.gn ('k') | fpdfsdk/fpdfview.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 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef CORE_FPDFAPI_CPDF_MODULEMGR_H_ 7 #ifndef CORE_FPDFAPI_CPDF_MODULEMGR_H_
8 #define CORE_FPDFAPI_CPDF_MODULEMGR_H_ 8 #define CORE_FPDFAPI_CPDF_MODULEMGR_H_
9 9
10 #include <memory> 10 #include <memory>
(...skipping 17 matching lines...) Expand all
28 28
29 void* GetUnspInfo() const { return m_unsp_info; } 29 void* GetUnspInfo() const { return m_unsp_info; }
30 30
31 private: 31 private:
32 void* const m_unsp_info; 32 void* const m_unsp_info;
33 }; 33 };
34 34
35 class CPDF_ModuleMgr { 35 class CPDF_ModuleMgr {
36 public: 36 public:
37 static CPDF_ModuleMgr* Get(); 37 static CPDF_ModuleMgr* Get();
38 static void Create();
39 static void Destroy(); 38 static void Destroy();
40 static const int kFileBufSize = 512; 39 static const int kFileBufSize = 512;
41 40
42 void SetCodecModule(CCodec_ModuleMgr* pModule) { m_pCodecModule = pModule; } 41 void SetCodecModule(CCodec_ModuleMgr* pModule) { m_pCodecModule = pModule; }
43 CCodec_ModuleMgr* GetCodecModule() { return m_pCodecModule; } 42 CCodec_ModuleMgr* GetCodecModule() { return m_pCodecModule; }
44 43
45 void InitPageModule(); 44 void InitPageModule();
46 CPDF_PageModule* GetPageModule() const { return m_pPageModule.get(); } 45 CPDF_PageModule* GetPageModule() const { return m_pPageModule.get(); }
47 46
48 void SetUnsupportInfoAdapter( 47 void SetUnsupportInfoAdapter(
(...skipping 19 matching lines...) Expand all
68 private: 67 private:
69 CPDF_ModuleMgr(); 68 CPDF_ModuleMgr();
70 ~CPDF_ModuleMgr(); 69 ~CPDF_ModuleMgr();
71 70
72 CCodec_ModuleMgr* m_pCodecModule; 71 CCodec_ModuleMgr* m_pCodecModule;
73 std::unique_ptr<CPDF_PageModule> m_pPageModule; 72 std::unique_ptr<CPDF_PageModule> m_pPageModule;
74 std::unique_ptr<CFSDK_UnsupportInfo_Adapter> m_pUnsupportInfoAdapter; 73 std::unique_ptr<CFSDK_UnsupportInfo_Adapter> m_pUnsupportInfoAdapter;
75 }; 74 };
76 75
77 #endif // CORE_FPDFAPI_CPDF_MODULEMGR_H_ 76 #endif // CORE_FPDFAPI_CPDF_MODULEMGR_H_
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | fpdfsdk/fpdfview.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698