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

Side by Side Diff: core/fpdfapi/fpdf_basic_module.cpp

Issue 2013483003: Remove CFX_PrivateData from CPDF_ModuleMgr (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Re-order two lines in .gyp file. Created 4 years, 7 months 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 | « core/fpdfapi/cpdf_modulemgr.cpp ('k') | core/fpdfapi/include/cpdf_modulemgr.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #include "core/fpdfapi/include/cpdf_modulemgr.h"
8
9 #include "core/fpdfapi/fpdf_page/cpdf_pagemodule.h"
10 #include "core/fxcodec/include/fx_codec.h"
11
12 namespace {
13
14 CPDF_ModuleMgr* g_FPDFAPI_pDefaultMgr = nullptr;
15
16 } // namespace
17
18 // static
19 CPDF_ModuleMgr* CPDF_ModuleMgr::Get() {
20 return g_FPDFAPI_pDefaultMgr;
21 }
22
23 // static
24 void CPDF_ModuleMgr::Create() {
25 ASSERT(!g_FPDFAPI_pDefaultMgr);
26 g_FPDFAPI_pDefaultMgr = new CPDF_ModuleMgr;
27 }
28
29 // static
30 void CPDF_ModuleMgr::Destroy() {
31 delete g_FPDFAPI_pDefaultMgr;
32 g_FPDFAPI_pDefaultMgr = nullptr;
33 }
34
35 CPDF_ModuleMgr::CPDF_ModuleMgr() : m_pCodecModule(nullptr) {}
36
37 CPDF_ModuleMgr::~CPDF_ModuleMgr() {}
38
39 void CPDF_ModuleMgr::SetPrivateData(void* module_id,
40 void* pData,
41 PD_CALLBACK_FREEDATA callback) {
42 m_privateData.SetPrivateData(module_id, pData, callback);
43 }
44
45 void* CPDF_ModuleMgr::GetPrivateData(void* module_id) {
46 return m_privateData.GetPrivateData(module_id);
47 }
48
49 CCodec_FaxModule* CPDF_ModuleMgr::GetFaxModule() {
50 return m_pCodecModule ? m_pCodecModule->GetFaxModule() : nullptr;
51 }
52
53 CCodec_JpegModule* CPDF_ModuleMgr::GetJpegModule() {
54 return m_pCodecModule ? m_pCodecModule->GetJpegModule() : nullptr;
55 }
56
57 CCodec_JpxModule* CPDF_ModuleMgr::GetJpxModule() {
58 return m_pCodecModule ? m_pCodecModule->GetJpxModule() : nullptr;
59 }
60
61 CCodec_Jbig2Module* CPDF_ModuleMgr::GetJbig2Module() {
62 return m_pCodecModule ? m_pCodecModule->GetJbig2Module() : nullptr;
63 }
64
65 CCodec_IccModule* CPDF_ModuleMgr::GetIccModule() {
66 return m_pCodecModule ? m_pCodecModule->GetIccModule() : nullptr;
67 }
68
69 CCodec_FlateModule* CPDF_ModuleMgr::GetFlateModule() {
70 return m_pCodecModule ? m_pCodecModule->GetFlateModule() : nullptr;
71 }
OLDNEW
« no previous file with comments | « core/fpdfapi/cpdf_modulemgr.cpp ('k') | core/fpdfapi/include/cpdf_modulemgr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698