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

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

Issue 1433503002: Add test for CPDF_SyntaxParser::ReadHexString. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 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
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 "../../../public/fpdf_dataavail.h" 10 #include "../../../public/fpdf_dataavail.h"
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 292
293 FX_BOOL IsEncrypted() { return m_pCryptoHandler != NULL; } 293 FX_BOOL IsEncrypted() { return m_pCryptoHandler != NULL; }
294 294
295 FX_BOOL GetCharAt(FX_FILESIZE pos, uint8_t& ch); 295 FX_BOOL GetCharAt(FX_FILESIZE pos, uint8_t& ch);
296 296
297 FX_BOOL ReadBlock(uint8_t* pBuf, FX_DWORD size); 297 FX_BOOL ReadBlock(uint8_t* pBuf, FX_DWORD size);
298 298
299 CFX_ByteString GetNextWord(FX_BOOL& bIsNumber); 299 CFX_ByteString GetNextWord(FX_BOOL& bIsNumber);
300 300
301 protected: 301 protected:
302 friend class CPDF_Parser;
303 friend class CPDF_DataAvail;
304 friend class fpdf_parser_parser_ReadHexString_Test;
305
302 static const int kParserMaxRecursionDepth = 64; 306 static const int kParserMaxRecursionDepth = 64;
303 static int s_CurrentRecursionDepth; 307 static int s_CurrentRecursionDepth;
304 308
305 virtual FX_BOOL GetNextChar(uint8_t& ch); 309 virtual FX_BOOL GetNextChar(uint8_t& ch);
306 310
307 FX_BOOL GetCharAtBackward(FX_FILESIZE pos, uint8_t& ch); 311 FX_BOOL GetCharAtBackward(FX_FILESIZE pos, uint8_t& ch);
308 312
309 void GetNextWord(); 313 void GetNextWord();
310 314
311 FX_BOOL IsWholeWord(FX_FILESIZE startpos, 315 FX_BOOL IsWholeWord(FX_FILESIZE startpos,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 349
346 nonstd::unique_ptr<CPDF_CryptoHandler> m_pCryptoHandler; 350 nonstd::unique_ptr<CPDF_CryptoHandler> m_pCryptoHandler;
347 351
348 uint8_t m_WordBuffer[257]; 352 uint8_t m_WordBuffer[257];
349 353
350 FX_DWORD m_WordSize; 354 FX_DWORD m_WordSize;
351 355
352 FX_BOOL m_bIsNumber; 356 FX_BOOL m_bIsNumber;
353 357
354 FX_FILESIZE m_dwWordPos; 358 FX_FILESIZE m_dwWordPos;
355 friend class CPDF_Parser;
356 friend class CPDF_DataAvail;
357 }; 359 };
358 360
359 #define PDFPARSE_TYPEONLY 1 361 #define PDFPARSE_TYPEONLY 1
360 #define PDFPARSE_NOSTREAM 2 362 #define PDFPARSE_NOSTREAM 2
361 struct PARSE_CONTEXT { 363 struct PARSE_CONTEXT {
362 uint32_t m_Flags; 364 uint32_t m_Flags;
363 FX_FILESIZE m_DictStart; 365 FX_FILESIZE m_DictStart;
364 FX_FILESIZE m_DictEnd; 366 FX_FILESIZE m_DictEnd;
365 FX_FILESIZE m_DataStart; 367 FX_FILESIZE m_DataStart;
366 FX_FILESIZE m_DataEnd; 368 FX_FILESIZE m_DataEnd;
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 FX_DWORD src_size, 968 FX_DWORD src_size,
967 const CPDF_Dictionary* pDict, 969 const CPDF_Dictionary* pDict,
968 uint8_t*& dest_buf, 970 uint8_t*& dest_buf,
969 FX_DWORD& dest_size, 971 FX_DWORD& dest_size,
970 CFX_ByteString& ImageEncoding, 972 CFX_ByteString& ImageEncoding,
971 CPDF_Dictionary*& pImageParms, 973 CPDF_Dictionary*& pImageParms,
972 FX_DWORD estimated_size, 974 FX_DWORD estimated_size,
973 FX_BOOL bImageAcc); 975 FX_BOOL bImageAcc);
974 976
975 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ 977 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698