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/fxcrt | |
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/fxcrt')
-rw-r--r-- | core/fxcrt/fx_basic_util.cpp | 4 | ||||
-rw-r--r-- | core/fxcrt/include/fx_basic.h | 2 | ||||
-rw-r--r-- | core/fxcrt/include/fx_memory.h | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/core/fxcrt/fx_basic_util.cpp b/core/fxcrt/fx_basic_util.cpp index 2d3483e9b3..b073ea8f17 100644 --- a/core/fxcrt/fx_basic_util.cpp +++ b/core/fxcrt/fx_basic_util.cpp @@ -27,7 +27,7 @@ void FX_PRIVATEDATA::FreeData() { return; } if (m_bSelfDestruct) { - delete (CFX_DestructObject*)m_pData; + delete static_cast<CFX_Deletable*>(m_pData); } else if (m_pCallback) { m_pCallback(m_pData); } @@ -57,7 +57,7 @@ void CFX_PrivateData::SetPrivateData(void* pModuleId, PD_CALLBACK_FREEDATA callback) { AddData(pModuleId, pData, callback, FALSE); } -void CFX_PrivateData::SetPrivateObj(void* pModuleId, CFX_DestructObject* pObj) { +void CFX_PrivateData::SetPrivateObj(void* pModuleId, CFX_Deletable* pObj) { AddData(pModuleId, pObj, NULL, TRUE); } FX_BOOL CFX_PrivateData::RemovePrivateData(void* pModuleId) { diff --git a/core/fxcrt/include/fx_basic.h b/core/fxcrt/include/fx_basic.h index 848429e8f3..0f517e7217 100644 --- a/core/fxcrt/include/fx_basic.h +++ b/core/fxcrt/include/fx_basic.h @@ -639,7 +639,7 @@ class CFX_PrivateData { void SetPrivateData(void* module_id, void* pData, PD_CALLBACK_FREEDATA callback); - void SetPrivateObj(void* module_id, CFX_DestructObject* pObj); + void SetPrivateObj(void* module_id, CFX_Deletable* pObj); void* GetPrivateData(void* module_id); FX_BOOL LookupPrivateData(void* module_id, void*& pData) const { diff --git a/core/fxcrt/include/fx_memory.h b/core/fxcrt/include/fx_memory.h index 2614016550..3048897d76 100644 --- a/core/fxcrt/include/fx_memory.h +++ b/core/fxcrt/include/fx_memory.h @@ -100,9 +100,9 @@ struct ReleaseDeleter { inline void operator()(T* ptr) const { ptr->Release(); } }; -class CFX_DestructObject { +class CFX_Deletable { public: - virtual ~CFX_DestructObject() {} + virtual ~CFX_Deletable() {} }; #endif // __cplusplus |