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

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

Issue 2466023002: Unify some code (Closed)
Patch Set: Fix review issues. 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_PARSER_H_ 7 #ifndef CORE_FPDFAPI_PARSER_CPDF_PARSER_H_
8 #define CORE_FPDFAPI_PARSER_CPDF_PARSER_H_ 8 #define CORE_FPDFAPI_PARSER_CPDF_PARSER_H_
9 9
10 #include <map> 10 #include <map>
11 #include <memory> 11 #include <memory>
12 #include <set> 12 #include <set>
13 #include <vector> 13 #include <vector>
14 14
15 #include "core/fxcrt/fx_basic.h" 15 #include "core/fxcrt/fx_basic.h"
16 16
17 class CPDF_Array; 17 class CPDF_Array;
18 class CPDF_CryptoHandler; 18 class CPDF_CryptoHandler;
19 class CPDF_Dictionary; 19 class CPDF_Dictionary;
20 class CPDF_Document; 20 class CPDF_Document;
21 class CPDF_IndirectObjectHolder; 21 class CPDF_IndirectObjectHolder;
22 class CPDF_Linearized;
22 class CPDF_Object; 23 class CPDF_Object;
23 class CPDF_SecurityHandler; 24 class CPDF_SecurityHandler;
24 class CPDF_StreamAcc; 25 class CPDF_StreamAcc;
25 class CPDF_SyntaxParser; 26 class CPDF_SyntaxParser;
26 class IFX_SeekableReadStream; 27 class IFX_SeekableReadStream;
27 28
28 class CPDF_Parser { 29 class CPDF_Parser {
29 public: 30 public:
30 enum Error { 31 enum Error {
31 SUCCESS = 0, 32 SUCCESS = 0,
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 int m_FileVersion; 152 int m_FileVersion;
152 CPDF_Dictionary* m_pTrailer; 153 CPDF_Dictionary* m_pTrailer;
153 CPDF_Dictionary* m_pEncryptDict; 154 CPDF_Dictionary* m_pEncryptDict;
154 FX_FILESIZE m_LastXRefOffset; 155 FX_FILESIZE m_LastXRefOffset;
155 FX_BOOL m_bXRefStream; 156 FX_BOOL m_bXRefStream;
156 std::unique_ptr<CPDF_SecurityHandler> m_pSecurityHandler; 157 std::unique_ptr<CPDF_SecurityHandler> m_pSecurityHandler;
157 CFX_ByteString m_Password; 158 CFX_ByteString m_Password;
158 std::set<FX_FILESIZE> m_SortedOffset; 159 std::set<FX_FILESIZE> m_SortedOffset;
159 std::vector<CPDF_Dictionary*> m_Trailers; 160 std::vector<CPDF_Dictionary*> m_Trailers;
160 bool m_bVersionUpdated; 161 bool m_bVersionUpdated;
161 CPDF_Object* m_pLinearized; 162 std::unique_ptr<CPDF_Linearized> m_pLinearized;
162 uint32_t m_dwFirstPageNo; 163 uint32_t m_dwFirstPageNo;
163 uint32_t m_dwXrefStartObjNum; 164 uint32_t m_dwXrefStartObjNum;
164 165
165 // A map of object numbers to indirect streams. Map owns the streams. 166 // A map of object numbers to indirect streams. Map owns the streams.
166 std::map<uint32_t, std::unique_ptr<CPDF_StreamAcc>> m_ObjectStreamMap; 167 std::map<uint32_t, std::unique_ptr<CPDF_StreamAcc>> m_ObjectStreamMap;
167 168
168 // Mapping of object numbers to offsets. The offsets are relative to the first 169 // Mapping of object numbers to offsets. The offsets are relative to the first
169 // object in the stream. 170 // object in the stream.
170 using StreamObjectCache = std::map<uint32_t, uint32_t>; 171 using StreamObjectCache = std::map<uint32_t, uint32_t>;
171 172
172 // Mapping of streams to their object caches. This is valid as long as the 173 // Mapping of streams to their object caches. This is valid as long as the
173 // streams in |m_ObjectStreamMap| are valid. 174 // streams in |m_ObjectStreamMap| are valid.
174 std::map<CPDF_StreamAcc*, StreamObjectCache> m_ObjCache; 175 std::map<CPDF_StreamAcc*, StreamObjectCache> m_ObjCache;
175 176
176 // All indirect object numbers that are being parsed. 177 // All indirect object numbers that are being parsed.
177 std::set<uint32_t> m_ParsingObjNums; 178 std::set<uint32_t> m_ParsingObjNums;
178 }; 179 };
179 180
180 #endif // CORE_FPDFAPI_PARSER_CPDF_PARSER_H_ 181 #endif // CORE_FPDFAPI_PARSER_CPDF_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698