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

Unified Diff: core/fpdfapi/fpdf_parser/include/cpdf_parser.h

Issue 2267173005: Removing CPDF_Parser::CloseParser. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_parser.cpp ('k') | fpdfsdk/fpdfview.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_parser/include/cpdf_parser.h
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_parser.h b/core/fpdfapi/fpdf_parser/include/cpdf_parser.h
index d6a5d5703b7088a94495b20d034e31e971bba763..3d2408fad10046c1a1f827035132a8af0cb6045e 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_parser.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_parser.h
@@ -95,14 +95,37 @@ class CPDF_Parser {
uint16_t gennum;
};
- void CloseParser();
+ std::unique_ptr<CPDF_SyntaxParser> m_pSyntax;
+ std::map<uint32_t, ObjectInfo> m_ObjectInfo;
+
+ bool LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, FX_BOOL bSkip);
+ FX_BOOL RebuildCrossRef();
+
+ private:
+ friend class CPDF_DataAvail;
+
+ enum class ParserState {
+ kDefault,
+ kComment,
+ kWhitespace,
+ kString,
+ kHexString,
+ kEscapedString,
+ kXref,
+ kObjNum,
+ kPostObjNum,
+ kGenNum,
+ kPostGenNum,
+ kTrailer,
+ kBeginObj,
+ kEndObj
+ };
+
CPDF_Object* ParseDirect(CPDF_Object* pObj);
FX_BOOL LoadAllCrossRefV4(FX_FILESIZE pos);
FX_BOOL LoadAllCrossRefV5(FX_FILESIZE pos);
- bool LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, FX_BOOL bSkip);
FX_BOOL LoadCrossRefV5(FX_FILESIZE* pos, FX_BOOL bMainXRef);
CPDF_Dictionary* LoadTrailerV4();
- FX_BOOL RebuildCrossRef();
Error SetEncryptHandler();
void ReleaseEncryptHandler();
FX_BOOL LoadLinearizedAllCrossRefV4(FX_FILESIZE pos, uint32_t dwObjCount);
@@ -118,7 +141,7 @@ class CPDF_Parser {
bool VerifyCrossRefV4();
CPDF_Document* m_pDocument; // not owned
- std::unique_ptr<CPDF_SyntaxParser> m_pSyntax;
+ bool m_bHasParsed;
bool m_bOwnFileRead;
int m_FileVersion;
CPDF_Dictionary* m_pTrailer;
@@ -127,7 +150,6 @@ class CPDF_Parser {
FX_BOOL m_bXRefStream;
std::unique_ptr<CPDF_SecurityHandler> m_pSecurityHandler;
CFX_ByteString m_Password;
- std::map<uint32_t, ObjectInfo> m_ObjectInfo;
std::set<FX_FILESIZE> m_SortedOffset;
CFX_ArrayTemplate<CPDF_Dictionary*> m_Trailers;
bool m_bVersionUpdated;
@@ -149,25 +171,7 @@ class CPDF_Parser {
// All indirect object numbers that are being parsed.
std::set<uint32_t> m_ParsingObjNums;
- friend class CPDF_DataAvail;
- private:
- enum class ParserState {
- kDefault,
- kComment,
- kWhitespace,
- kString,
- kHexString,
- kEscapedString,
- kXref,
- kObjNum,
- kPostObjNum,
- kGenNum,
- kPostGenNum,
- kTrailer,
- kBeginObj,
- kEndObj
- };
};
#endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_PARSER_H_
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_parser.cpp ('k') | fpdfsdk/fpdfview.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698