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

Side by Side Diff: core/include/fpdfapi/fpdf_parser.h

Issue 1424923007: Merge to XFA: Add test for CPDF_SyntaxParser::ReadHexString. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Merge in test fix. Created 5 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 | « BUILD.gn ('k') | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_unittest.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 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 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_INCLUDE_FPDFAPI_FPDF_PARSER_H_ 7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_
8 #define CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ 8 #define CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_
9 9
10 #include "../../../third_party/base/nonstd_unique_ptr.h" 10 #include "../../../third_party/base/nonstd_unique_ptr.h"
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 289
290 FX_BOOL IsEncrypted() { return m_pCryptoHandler != NULL; } 290 FX_BOOL IsEncrypted() { return m_pCryptoHandler != NULL; }
291 291
292 FX_BOOL GetCharAt(FX_FILESIZE pos, uint8_t& ch); 292 FX_BOOL GetCharAt(FX_FILESIZE pos, uint8_t& ch);
293 293
294 FX_BOOL ReadBlock(uint8_t* pBuf, FX_DWORD size); 294 FX_BOOL ReadBlock(uint8_t* pBuf, FX_DWORD size);
295 295
296 CFX_ByteString GetNextWord(FX_BOOL& bIsNumber); 296 CFX_ByteString GetNextWord(FX_BOOL& bIsNumber);
297 297
298 protected: 298 protected:
299 friend class CPDF_Parser;
300 friend class CPDF_DataAvail;
301 friend class fpdf_parser_parser_ReadHexString_Test;
302
299 static const int kParserMaxRecursionDepth = 64; 303 static const int kParserMaxRecursionDepth = 64;
300 static int s_CurrentRecursionDepth; 304 static int s_CurrentRecursionDepth;
301 305
302 virtual FX_BOOL GetNextChar(uint8_t& ch); 306 virtual FX_BOOL GetNextChar(uint8_t& ch);
303 307
304 FX_BOOL GetCharAtBackward(FX_FILESIZE pos, uint8_t& ch); 308 FX_BOOL GetCharAtBackward(FX_FILESIZE pos, uint8_t& ch);
305 309
306 void GetNextWord(); 310 void GetNextWord();
307 311
308 FX_BOOL IsWholeWord(FX_FILESIZE startpos, 312 FX_BOOL IsWholeWord(FX_FILESIZE startpos,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 346
343 nonstd::unique_ptr<CPDF_CryptoHandler> m_pCryptoHandler; 347 nonstd::unique_ptr<CPDF_CryptoHandler> m_pCryptoHandler;
344 348
345 uint8_t m_WordBuffer[257]; 349 uint8_t m_WordBuffer[257];
346 350
347 FX_DWORD m_WordSize; 351 FX_DWORD m_WordSize;
348 352
349 FX_BOOL m_bIsNumber; 353 FX_BOOL m_bIsNumber;
350 354
351 FX_FILESIZE m_dwWordPos; 355 FX_FILESIZE m_dwWordPos;
352 friend class CPDF_Parser;
353 friend class CPDF_DataAvail;
354 }; 356 };
355 357
356 #define PDFPARSE_TYPEONLY 1 358 #define PDFPARSE_TYPEONLY 1
357 #define PDFPARSE_NOSTREAM 2 359 #define PDFPARSE_NOSTREAM 2
358 struct PARSE_CONTEXT { 360 struct PARSE_CONTEXT {
359 uint32_t m_Flags; 361 uint32_t m_Flags;
360 FX_FILESIZE m_DictStart; 362 FX_FILESIZE m_DictStart;
361 FX_FILESIZE m_DictEnd; 363 FX_FILESIZE m_DictEnd;
362 FX_FILESIZE m_DataStart; 364 FX_FILESIZE m_DataStart;
363 FX_FILESIZE m_DataEnd; 365 FX_FILESIZE m_DataEnd;
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 FX_DWORD src_size, 969 FX_DWORD src_size,
968 const CPDF_Dictionary* pDict, 970 const CPDF_Dictionary* pDict,
969 uint8_t*& dest_buf, 971 uint8_t*& dest_buf,
970 FX_DWORD& dest_size, 972 FX_DWORD& dest_size,
971 CFX_ByteString& ImageEncoding, 973 CFX_ByteString& ImageEncoding,
972 CPDF_Dictionary*& pImageParms, 974 CPDF_Dictionary*& pImageParms,
973 FX_DWORD estimated_size, 975 FX_DWORD estimated_size,
974 FX_BOOL bImageAcc); 976 FX_BOOL bImageAcc);
975 977
976 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ 978 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_unittest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698