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

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

Issue 2517513003: Add unit test for CXFA_FileRead. (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
« no previous file with comments | « core/fpdfapi/edit/fpdf_edit_create.cpp ('k') | core/fpdfapi/parser/cpdf_stream.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_STREAM_H_ 7 #ifndef CORE_FPDFAPI_PARSER_CPDF_STREAM_H_
8 #define CORE_FPDFAPI_PARSER_CPDF_STREAM_H_ 8 #define CORE_FPDFAPI_PARSER_CPDF_STREAM_H_
9 9
10 #include <memory> 10 #include <memory>
(...skipping 28 matching lines...) Expand all
39 39
40 void InitStream(const uint8_t* pData, uint32_t size, CPDF_Dictionary* pDict); 40 void InitStream(const uint8_t* pData, uint32_t size, CPDF_Dictionary* pDict);
41 void InitStreamFromFile(IFX_SeekableReadStream* pFile, 41 void InitStreamFromFile(IFX_SeekableReadStream* pFile,
42 CPDF_Dictionary* pDict); 42 CPDF_Dictionary* pDict);
43 43
44 bool ReadRawData(FX_FILESIZE start_pos, 44 bool ReadRawData(FX_FILESIZE start_pos,
45 uint8_t* pBuf, 45 uint8_t* pBuf,
46 uint32_t buf_size) const; 46 uint32_t buf_size) const;
47 47
48 bool IsMemoryBased() const { return m_bMemoryBased; } 48 bool IsMemoryBased() const { return m_bMemoryBased; }
49 bool HasFilter() const;
49 50
50 protected: 51 protected:
51 std::unique_ptr<CPDF_Object> CloneNonCyclic( 52 std::unique_ptr<CPDF_Object> CloneNonCyclic(
52 bool bDirect, 53 bool bDirect,
53 std::set<const CPDF_Object*>* pVisited) const override; 54 std::set<const CPDF_Object*>* pVisited) const override;
54 55
55 bool m_bMemoryBased = true; 56 bool m_bMemoryBased = true;
56 uint32_t m_dwSize = 0; 57 uint32_t m_dwSize = 0;
57 std::unique_ptr<CPDF_Dictionary> m_pDict; 58 std::unique_ptr<CPDF_Dictionary> m_pDict;
58 std::unique_ptr<uint8_t, FxFreeDeleter> m_pDataBuf; 59 std::unique_ptr<uint8_t, FxFreeDeleter> m_pDataBuf;
(...skipping 10 matching lines...) Expand all
69 70
70 inline std::unique_ptr<CPDF_Stream> ToStream(std::unique_ptr<CPDF_Object> obj) { 71 inline std::unique_ptr<CPDF_Stream> ToStream(std::unique_ptr<CPDF_Object> obj) {
71 CPDF_Stream* pStream = ToStream(obj.get()); 72 CPDF_Stream* pStream = ToStream(obj.get());
72 if (!pStream) 73 if (!pStream)
73 return nullptr; 74 return nullptr;
74 obj.release(); 75 obj.release();
75 return std::unique_ptr<CPDF_Stream>(pStream); 76 return std::unique_ptr<CPDF_Stream>(pStream);
76 } 77 }
77 78
78 #endif // CORE_FPDFAPI_PARSER_CPDF_STREAM_H_ 79 #endif // CORE_FPDFAPI_PARSER_CPDF_STREAM_H_
OLDNEW
« no previous file with comments | « core/fpdfapi/edit/fpdf_edit_create.cpp ('k') | core/fpdfapi/parser/cpdf_stream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698