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

Side by Side Diff: core/fpdfapi/parser/cpdf_document.h

Issue 2479303002: Use unique_ptr return from CPDF_Parser::ParseIndirectObject() (Closed)
Patch Set: Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef CORE_FPDFAPI_PARSER_CPDF_DOCUMENT_H_ 7 #ifndef CORE_FPDFAPI_PARSER_CPDF_DOCUMENT_H_
8 #define CORE_FPDFAPI_PARSER_CPDF_DOCUMENT_H_ 8 #define CORE_FPDFAPI_PARSER_CPDF_DOCUMENT_H_
9 9
10 #include <functional> 10 #include <functional>
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 protected: 105 protected:
106 // Retrieve page count information by getting count value from the tree nodes 106 // Retrieve page count information by getting count value from the tree nodes
107 int RetrievePageCount() const; 107 int RetrievePageCount() const;
108 // When this method is called, m_pTreeTraversal[level] exists. 108 // When this method is called, m_pTreeTraversal[level] exists.
109 CPDF_Dictionary* TraversePDFPages(int iPage, int* nPagesToGo, size_t level); 109 CPDF_Dictionary* TraversePDFPages(int iPage, int* nPagesToGo, size_t level);
110 int FindPageIndex(CPDF_Dictionary* pNode, 110 int FindPageIndex(CPDF_Dictionary* pNode,
111 uint32_t& skip_count, 111 uint32_t& skip_count,
112 uint32_t objnum, 112 uint32_t objnum,
113 int& index, 113 int& index,
114 int level = 0); 114 int level = 0);
115 CPDF_Object* ParseIndirectObject(uint32_t objnum) override; 115 std::unique_ptr<CPDF_Object> ParseIndirectObject(uint32_t objnum) override;
116 void LoadDocInternal(); 116 void LoadDocInternal();
117 size_t CalculateEncodingDict(int charset, CPDF_Dictionary* pBaseDict); 117 size_t CalculateEncodingDict(int charset, CPDF_Dictionary* pBaseDict);
118 CPDF_Dictionary* GetPagesDict() const; 118 CPDF_Dictionary* GetPagesDict() const;
119 CPDF_Dictionary* ProcessbCJK( 119 CPDF_Dictionary* ProcessbCJK(
120 CPDF_Dictionary* pBaseDict, 120 CPDF_Dictionary* pBaseDict,
121 int charset, 121 int charset,
122 bool bVert, 122 bool bVert,
123 CFX_ByteString basefont, 123 CFX_ByteString basefont,
124 std::function<void(FX_WCHAR, FX_WCHAR, CPDF_Array*)> Insert); 124 std::function<void(FX_WCHAR, FX_WCHAR, CPDF_Array*)> Insert);
125 bool InsertDeletePDFPage(CPDF_Dictionary* pPages, 125 bool InsertDeletePDFPage(CPDF_Dictionary* pPages,
(...skipping 20 matching lines...) Expand all
146 // TODO(thestig): Figure out why this cannot be a std::unique_ptr. 146 // TODO(thestig): Figure out why this cannot be a std::unique_ptr.
147 CPDF_DocPageData* m_pDocPage; 147 CPDF_DocPageData* m_pDocPage;
148 std::unique_ptr<CPDF_DocRenderData> m_pDocRender; 148 std::unique_ptr<CPDF_DocRenderData> m_pDocRender;
149 std::unique_ptr<JBig2_DocumentContext> m_pCodecContext; 149 std::unique_ptr<JBig2_DocumentContext> m_pCodecContext;
150 std::unique_ptr<CPDF_LinkList> m_pLinksContext; 150 std::unique_ptr<CPDF_LinkList> m_pLinksContext;
151 CFX_ArrayTemplate<uint32_t> m_PageList; 151 CFX_ArrayTemplate<uint32_t> m_PageList;
152 CFX_WeakPtr<CFX_ByteStringPool> m_pByteStringPool; 152 CFX_WeakPtr<CFX_ByteStringPool> m_pByteStringPool;
153 }; 153 };
154 154
155 #endif // CORE_FPDFAPI_PARSER_CPDF_DOCUMENT_H_ 155 #endif // CORE_FPDFAPI_PARSER_CPDF_DOCUMENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698