diff options
author | tsepez <tsepez@chromium.org> | 2016-05-24 16:20:29 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-24 16:20:29 -0700 |
commit | ddffb57cf9763e2612e9f6f5730f334691adb692 (patch) | |
tree | 9f7798eb5eb71fb5cb40aadc1da940891c71aa0b /core/fpdfapi/include | |
parent | 5aaa9bc9193d74bb188dd1f890140cf38fb06605 (diff) | |
download | pdfium-ddffb57cf9763e2612e9f6f5730f334691adb692.tar.xz |
Remove CFX_PrivateData from CPDF_ModuleMgr
Its only used to store one object, so replace it with a unique_ptr
to a class with a virtual dtor. Rename the prototypical class with
virtual dtor from CFX_DestructObject to CFX_Deletable. Rename the
fx_basic_module.cpp to cfx_modulemgr.cpp to match the one class
in it.
Review-Url: https://codereview.chromium.org/2013483003
Diffstat (limited to 'core/fpdfapi/include')
-rw-r--r-- | core/fpdfapi/include/cpdf_modulemgr.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/core/fpdfapi/include/cpdf_modulemgr.h b/core/fpdfapi/include/cpdf_modulemgr.h index e54bd07a90..95c5385e64 100644 --- a/core/fpdfapi/include/cpdf_modulemgr.h +++ b/core/fpdfapi/include/cpdf_modulemgr.h @@ -11,14 +11,13 @@ #include "core/fxcrt/include/fx_basic.h" -class CCodec_ModuleMgr; class CCodec_FaxModule; class CCodec_FlateModule; class CCodec_IccModule; class CCodec_Jbig2Module; class CCodec_JpegModule; class CCodec_JpxModule; - +class CCodec_ModuleMgr; class CPDF_PageModule; class CPDF_ModuleMgr { @@ -32,9 +31,15 @@ class CPDF_ModuleMgr { CCodec_ModuleMgr* GetCodecModule() { return m_pCodecModule; } void InitPageModule(); - CPDF_PageModule* GetPageModule() const { return m_pPageModule.get(); } + void SetUnsupportInfoAdapter(std::unique_ptr<CFX_Deletable> pAdapter) { + m_pUnsupportInfoAdapter = std::move(pAdapter); + } + CFX_Deletable* GetUnsupportInfoAdapter() const { + return m_pUnsupportInfoAdapter.get(); + } + void LoadEmbeddedGB1CMaps(); void LoadEmbeddedCNS1CMaps(); void LoadEmbeddedJapan1CMaps(); @@ -47,19 +52,13 @@ class CPDF_ModuleMgr { CCodec_IccModule* GetIccModule(); CCodec_FlateModule* GetFlateModule(); - void SetPrivateData(void* module_id, - void* pData, - PD_CALLBACK_FREEDATA callback); - - void* GetPrivateData(void* module_id); - private: CPDF_ModuleMgr(); ~CPDF_ModuleMgr(); CCodec_ModuleMgr* m_pCodecModule; std::unique_ptr<CPDF_PageModule> m_pPageModule; - CFX_PrivateData m_privateData; + std::unique_ptr<CFX_Deletable> m_pUnsupportInfoAdapter; }; #endif // CORE_FPDFAPI_INCLUDE_CPDF_MODULEMGR_H_ |