From d0f2dcd0802969494e991d8cef00b4bd81aefc8d Mon Sep 17 00:00:00 2001 From: Artem Strygin Date: Wed, 9 Aug 2017 22:44:57 +0300 Subject: Unify initialization of CPDF_Parser. Move syntax parser initialization in separate method. Change-Id: I701284b1fee26a474c24ca68948a3462cc68faec Reviewed-on: https://pdfium-review.googlesource.com/10291 Commit-Queue: Art Snake Reviewed-by: Lei Zhang --- core/fpdfapi/parser/cpdf_parser.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'core/fpdfapi/parser/cpdf_parser.h') diff --git a/core/fpdfapi/parser/cpdf_parser.h b/core/fpdfapi/parser/cpdf_parser.h index fd74c5471e..594171be46 100644 --- a/core/fpdfapi/parser/cpdf_parser.h +++ b/core/fpdfapi/parser/cpdf_parser.h @@ -152,9 +152,7 @@ class CPDF_Parser { ObjectInfo info; }; - Error StartParseInternal(const CFX_RetainPtr& pFile, - CPDF_Document* pDocument, - int32_t iHeaderOffset); + Error StartParseInternal(CPDF_Document* pDocument); CPDF_Object* ParseDirect(CPDF_Object* pObj); bool LoadAllCrossRefV4(FX_FILESIZE pos); bool LoadAllCrossRefV5(FX_FILESIZE pos); @@ -167,9 +165,7 @@ class CPDF_Parser { bool LoadLinearizedAllCrossRefV5(FX_FILESIZE pos); Error LoadLinearizedMainXRefTable(); CFX_RetainPtr GetObjectStream(uint32_t number); - bool IsLinearizedFile( - const CFX_RetainPtr& pFileAccess, - uint32_t offset); + bool ParseLinearizedHeader(); void SetEncryptDictionary(CPDF_Dictionary* pDict); void ShrinkObjectMap(uint32_t size); // A simple check whether the cross reference table matches with @@ -193,6 +189,10 @@ class CPDF_Parser { bool strict_parse, FX_FILESIZE* pResultPos); + bool InitSyntaxParser( + const CFX_RetainPtr& file_access); + bool ParseFileVersion(); + CFX_UnownedPtr m_pDocument; bool m_bHasParsed; bool m_bXRefStream; -- cgit v1.2.3