From 5ce09684216ed6b74836de9bd056b8f15bd66a4e Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 25 May 2016 16:16:32 -0700 Subject: Remove CFX_PrivateData from CPDF_Document Replace it with two generic slots for Links and Codec usage. Since the codec is at a lower layer than the document, we don't provide separate get/set methods, since having a document upon which to call these would be a layering violation. Do the same for the Links for simplicity. Review-Url: https://codereview.chromium.org/2005193003 --- core/fpdfapi/fpdf_parser/include/cpdf_document.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'core/fpdfapi/fpdf_parser/include') diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_document.h b/core/fpdfapi/fpdf_parser/include/cpdf_document.h index f7a7f9f183..e1d1c77a12 100644 --- a/core/fpdfapi/fpdf_parser/include/cpdf_document.h +++ b/core/fpdfapi/fpdf_parser/include/cpdf_document.h @@ -11,6 +11,7 @@ #include "core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_object.h" +#include "core/fpdfdoc/include/fpdf_doc.h" #include "core/fxcrt/include/fx_basic.h" class CFX_Font; @@ -35,7 +36,7 @@ class CPDF_StreamAcc; #define FPDFPERM_PRINT_HIGH 0x0800 #define FPDF_PAGE_MAX_NUM 0xFFFFF -class CPDF_Document : public CFX_PrivateData, public CPDF_IndirectObjectHolder { +class CPDF_Document : public CPDF_IndirectObjectHolder { public: explicit CPDF_Document(CPDF_Parser* pParser); ~CPDF_Document(); @@ -57,6 +58,9 @@ class CPDF_Document : public CFX_PrivateData, public CPDF_IndirectObjectHolder { void ClearPageData(); void RemoveColorSpaceFromPageData(CPDF_Object* pObject); + std::unique_ptr* CodecContext() { return &m_pCodecContext; } + std::unique_ptr* LinksContext() { return &m_pLinksContext; } + CPDF_DocRenderData* GetRenderData() const { return m_pDocRender.get(); } void ClearRenderData(); void ClearRenderFont(); @@ -107,7 +111,6 @@ class CPDF_Document : public CFX_PrivateData, public CPDF_IndirectObjectHolder { friend class CPDF_OCContext; // Retrieve page count information by getting count value from the tree nodes - // or walking through the tree nodes to calculate it. int RetrievePageCount() const; CPDF_Dictionary* FindPDFPage(CPDF_Dictionary* pPages, int iPage, @@ -131,6 +134,8 @@ class CPDF_Document : public CFX_PrivateData, public CPDF_IndirectObjectHolder { // TODO(thestig): Figure out why this cannot be a std::unique_ptr. CPDF_DocPageData* m_pDocPage; std::unique_ptr m_pDocRender; + std::unique_ptr m_pCodecContext; + std::unique_ptr m_pLinksContext; }; #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DOCUMENT_H_ -- cgit v1.2.3