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

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

Issue 2451493002: Refcount all the IFX_ stream classes all the time. (Closed)
Patch Set: Clean up cast expression Created 4 years 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/parser/cfdf_document.cpp ('k') | core/fpdfapi/parser/cpdf_data_avail.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_DATA_AVAIL_H_ 7 #ifndef CORE_FPDFAPI_PARSER_CPDF_DATA_AVAIL_H_
8 #define CORE_FPDFAPI_PARSER_CPDF_DATA_AVAIL_H_ 8 #define CORE_FPDFAPI_PARSER_CPDF_DATA_AVAIL_H_
9 9
10 #include <memory> 10 #include <memory>
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 virtual bool IsDataAvail(FX_FILESIZE offset, uint32_t size) = 0; 88 virtual bool IsDataAvail(FX_FILESIZE offset, uint32_t size) = 0;
89 }; 89 };
90 90
91 class DownloadHints { 91 class DownloadHints {
92 public: 92 public:
93 virtual ~DownloadHints(); 93 virtual ~DownloadHints();
94 virtual void AddSegment(FX_FILESIZE offset, uint32_t size) = 0; 94 virtual void AddSegment(FX_FILESIZE offset, uint32_t size) = 0;
95 }; 95 };
96 96
97 CPDF_DataAvail(FileAvail* pFileAvail, 97 CPDF_DataAvail(FileAvail* pFileAvail,
98 IFX_SeekableReadStream* pFileRead, 98 const CFX_RetainPtr<IFX_SeekableReadStream>& pFileRead,
99 bool bSupportHintTable); 99 bool bSupportHintTable);
100 ~CPDF_DataAvail(); 100 ~CPDF_DataAvail();
101 101
102 bool IsDataAvail(FX_FILESIZE offset, uint32_t size, DownloadHints* pHints); 102 bool IsDataAvail(FX_FILESIZE offset, uint32_t size, DownloadHints* pHints);
103 DocAvailStatus IsDocAvail(DownloadHints* pHints); 103 DocAvailStatus IsDocAvail(DownloadHints* pHints);
104 void SetDocument(CPDF_Document* pDoc); 104 void SetDocument(CPDF_Document* pDoc);
105 DocAvailStatus IsPageAvail(uint32_t dwPage, DownloadHints* pHints); 105 DocAvailStatus IsPageAvail(uint32_t dwPage, DownloadHints* pHints);
106 DocFormStatus IsFormAvail(DownloadHints* pHints); 106 DocFormStatus IsFormAvail(DownloadHints* pHints);
107 DocLinearizationStatus IsLinearizedPDF(); 107 DocLinearizationStatus IsLinearizedPDF();
108 bool IsLinearized(); 108 bool IsLinearized();
109 void GetLinearizedMainXRefInfo(FX_FILESIZE* pPos, uint32_t* pSize); 109 void GetLinearizedMainXRefInfo(FX_FILESIZE* pPos, uint32_t* pSize);
110 IFX_SeekableReadStream* GetFileRead() const { return m_pFileRead; } 110 CFX_RetainPtr<IFX_SeekableReadStream> GetFileRead() const {
111 return m_pFileRead;
112 }
111 int GetPageCount() const; 113 int GetPageCount() const;
112 CPDF_Dictionary* GetPage(int index); 114 CPDF_Dictionary* GetPage(int index);
113 115
114 protected: 116 protected:
115 class PageNode { 117 class PageNode {
116 public: 118 public:
117 PageNode(); 119 PageNode();
118 ~PageNode(); 120 ~PageNode();
119 121
120 PDF_PAGENODE_TYPE m_type; 122 PDF_PAGENODE_TYPE m_type;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 bool CheckArrayPageNode(uint32_t dwPageNo, 190 bool CheckArrayPageNode(uint32_t dwPageNo,
189 PageNode* pPageNode, 191 PageNode* pPageNode,
190 DownloadHints* pHints); 192 DownloadHints* pHints);
191 bool CheckPageCount(DownloadHints* pHints); 193 bool CheckPageCount(DownloadHints* pHints);
192 bool IsFirstCheck(uint32_t dwPage); 194 bool IsFirstCheck(uint32_t dwPage);
193 void ResetFirstCheck(uint32_t dwPage); 195 void ResetFirstCheck(uint32_t dwPage);
194 bool ValidatePage(uint32_t dwPage); 196 bool ValidatePage(uint32_t dwPage);
195 bool ValidateForm(); 197 bool ValidateForm();
196 198
197 FileAvail* const m_pFileAvail; 199 FileAvail* const m_pFileAvail;
198 IFX_SeekableReadStream* const m_pFileRead; 200 CFX_RetainPtr<IFX_SeekableReadStream> m_pFileRead;
199 CPDF_Parser m_parser; 201 CPDF_Parser m_parser;
200 CPDF_SyntaxParser m_syntaxParser; 202 CPDF_SyntaxParser m_syntaxParser;
201 std::unique_ptr<CPDF_Object> m_pRoot; 203 std::unique_ptr<CPDF_Object> m_pRoot;
202 uint32_t m_dwRootObjNum; 204 uint32_t m_dwRootObjNum;
203 uint32_t m_dwInfoObjNum; 205 uint32_t m_dwInfoObjNum;
204 std::unique_ptr<CPDF_LinearizedHeader> m_pLinearized; 206 std::unique_ptr<CPDF_LinearizedHeader> m_pLinearized;
205 CPDF_Object* m_pTrailer; 207 CPDF_Object* m_pTrailer;
206 bool m_bDocAvail; 208 bool m_bDocAvail;
207 FX_FILESIZE m_dwHeaderOffset; 209 FX_FILESIZE m_dwHeaderOffset;
208 FX_FILESIZE m_dwLastXRefOffset; 210 FX_FILESIZE m_dwLastXRefOffset;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 bool m_bTotalLoadPageTree; 248 bool m_bTotalLoadPageTree;
247 bool m_bCurPageDictLoadOK; 249 bool m_bCurPageDictLoadOK;
248 PageNode m_pageNodes; 250 PageNode m_pageNodes;
249 std::set<uint32_t> m_pageMapCheckState; 251 std::set<uint32_t> m_pageMapCheckState;
250 std::set<uint32_t> m_pagesLoadState; 252 std::set<uint32_t> m_pagesLoadState;
251 std::unique_ptr<CPDF_HintTables> m_pHintTables; 253 std::unique_ptr<CPDF_HintTables> m_pHintTables;
252 bool m_bSupportHintTable; 254 bool m_bSupportHintTable;
253 }; 255 };
254 256
255 #endif // CORE_FPDFAPI_PARSER_CPDF_DATA_AVAIL_H_ 257 #endif // CORE_FPDFAPI_PARSER_CPDF_DATA_AVAIL_H_
OLDNEW
« no previous file with comments | « core/fpdfapi/parser/cfdf_document.cpp ('k') | core/fpdfapi/parser/cpdf_data_avail.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698