diff options
author | Lei Zhang <thestig@chromium.org> | 2017-05-18 15:51:20 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-05-19 01:39:40 +0000 |
commit | 76020fc9751e55661d1c01b6cd92dfcb1fd56e6a (patch) | |
tree | 59d5251b23f5acb78891bf2911a79f2c70812c1c /core/fpdfapi/cpdf_modulemgr.h | |
parent | 22644731e0e46eae1f50927376e557c7d64db1d5 (diff) | |
download | pdfium-76020fc9751e55661d1c01b6cd92dfcb1fd56e6a.tar.xz |
Move CCodec_ModuleMgr ownership to CPDF_ModuleMgr.
More straight forward than CFX_GEModule owning in and CPDF_ModuleMgr
holding a pointer to it.
Remove assumptions that the codec modules may return nullptr, and do
IWYU.
Change-Id: Iba7fc3c7ec223fd6d29a1ab74ed13d35689bc5d5
Reviewed-on: https://pdfium-review.googlesource.com/5654
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/cpdf_modulemgr.h')
-rw-r--r-- | core/fpdfapi/cpdf_modulemgr.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/core/fpdfapi/cpdf_modulemgr.h b/core/fpdfapi/cpdf_modulemgr.h index 898b6ea0bc..82566ba282 100644 --- a/core/fpdfapi/cpdf_modulemgr.h +++ b/core/fpdfapi/cpdf_modulemgr.h @@ -38,11 +38,7 @@ class CPDF_ModuleMgr { static void Destroy(); static const int kFileBufSize = 512; - void SetCodecModule(CCodec_ModuleMgr* pModule) { m_pCodecModule = pModule; } - CCodec_ModuleMgr* GetCodecModule() { return m_pCodecModule; } - - void InitPageModule(); - CPDF_PageModule* GetPageModule() const { return m_pPageModule.get(); } + void Init(); void SetUnsupportInfoAdapter( std::unique_ptr<CFSDK_UnsupportInfo_Adapter> pAdapter) { @@ -52,8 +48,8 @@ class CPDF_ModuleMgr { return m_pUnsupportInfoAdapter.get(); } - void LoadEmbeddedMaps(); - void LoadCodecModules(); + CCodec_ModuleMgr* GetCodecModule() const { return m_pCodecModule.get(); } + CPDF_PageModule* GetPageModule() const { return m_pPageModule.get(); } CCodec_FaxModule* GetFaxModule(); CCodec_JpegModule* GetJpegModule(); @@ -66,12 +62,17 @@ class CPDF_ModuleMgr { CPDF_ModuleMgr(); ~CPDF_ModuleMgr(); + void InitCodecModule(); + void InitPageModule(); + void LoadEmbeddedMaps(); + void LoadCodecModules(); + void LoadEmbeddedGB1CMaps(); void LoadEmbeddedCNS1CMaps(); void LoadEmbeddedJapan1CMaps(); void LoadEmbeddedKorea1CMaps(); - CCodec_ModuleMgr* m_pCodecModule; + std::unique_ptr<CCodec_ModuleMgr> m_pCodecModule; std::unique_ptr<CPDF_PageModule> m_pPageModule; std::unique_ptr<CFSDK_UnsupportInfo_Adapter> m_pUnsupportInfoAdapter; }; |