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/fpdf_basic_module.cpp | |
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/fpdf_basic_module.cpp')
-rw-r--r-- | core/fpdfapi/fpdf_basic_module.cpp | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/core/fpdfapi/fpdf_basic_module.cpp b/core/fpdfapi/fpdf_basic_module.cpp deleted file mode 100644 index 75450bf975..0000000000 --- a/core/fpdfapi/fpdf_basic_module.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#include "core/fpdfapi/include/cpdf_modulemgr.h" - -#include "core/fpdfapi/fpdf_page/cpdf_pagemodule.h" -#include "core/fxcodec/include/fx_codec.h" - -namespace { - -CPDF_ModuleMgr* g_FPDFAPI_pDefaultMgr = nullptr; - -} // namespace - -// static -CPDF_ModuleMgr* CPDF_ModuleMgr::Get() { - return g_FPDFAPI_pDefaultMgr; -} - -// static -void CPDF_ModuleMgr::Create() { - ASSERT(!g_FPDFAPI_pDefaultMgr); - g_FPDFAPI_pDefaultMgr = new CPDF_ModuleMgr; -} - -// static -void CPDF_ModuleMgr::Destroy() { - delete g_FPDFAPI_pDefaultMgr; - g_FPDFAPI_pDefaultMgr = nullptr; -} - -CPDF_ModuleMgr::CPDF_ModuleMgr() : m_pCodecModule(nullptr) {} - -CPDF_ModuleMgr::~CPDF_ModuleMgr() {} - -void CPDF_ModuleMgr::SetPrivateData(void* module_id, - void* pData, - PD_CALLBACK_FREEDATA callback) { - m_privateData.SetPrivateData(module_id, pData, callback); -} - -void* CPDF_ModuleMgr::GetPrivateData(void* module_id) { - return m_privateData.GetPrivateData(module_id); -} - -CCodec_FaxModule* CPDF_ModuleMgr::GetFaxModule() { - return m_pCodecModule ? m_pCodecModule->GetFaxModule() : nullptr; -} - -CCodec_JpegModule* CPDF_ModuleMgr::GetJpegModule() { - return m_pCodecModule ? m_pCodecModule->GetJpegModule() : nullptr; -} - -CCodec_JpxModule* CPDF_ModuleMgr::GetJpxModule() { - return m_pCodecModule ? m_pCodecModule->GetJpxModule() : nullptr; -} - -CCodec_Jbig2Module* CPDF_ModuleMgr::GetJbig2Module() { - return m_pCodecModule ? m_pCodecModule->GetJbig2Module() : nullptr; -} - -CCodec_IccModule* CPDF_ModuleMgr::GetIccModule() { - return m_pCodecModule ? m_pCodecModule->GetIccModule() : nullptr; -} - -CCodec_FlateModule* CPDF_ModuleMgr::GetFlateModule() { - return m_pCodecModule ? m_pCodecModule->GetFlateModule() : nullptr; -} |