summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_parser.h
diff options
context:
space:
mode:
authorArtem Strygin <art-snake@yandex-team.ru>2017-08-02 14:27:22 +0300
committerChromium commit bot <commit-bot@chromium.org>2017-08-02 21:20:33 +0000
commit17b1c191da26e477c6898a8b06f2ff624f9e4c6b (patch)
tree6c383224fc0c8c1d9ef2c8eb9df6fe0352fe4b9a /core/fpdfapi/parser/cpdf_parser.h
parent17e54528fe0a2203074f4d086677d14c33cf7253 (diff)
downloadpdfium-17b1c191da26e477c6898a8b06f2ff624f9e4c6b.tar.xz
Unify parsing of cross refs v4
Change-Id: I7e3d45263a0bae61fd86fd4c3710de7fc0b9347d Reviewed-on: https://pdfium-review.googlesource.com/9290 Reviewed-by: Wei Li <weili@chromium.org> Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_parser.h')
-rw-r--r--core/fpdfapi/parser/cpdf_parser.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/fpdfapi/parser/cpdf_parser.h b/core/fpdfapi/parser/cpdf_parser.h
index ece1e6a2d4..759d042360 100644
--- a/core/fpdfapi/parser/cpdf_parser.h
+++ b/core/fpdfapi/parser/cpdf_parser.h
@@ -148,6 +148,11 @@ class CPDF_Parser {
kEndObj
};
+ struct CrossRefObjData {
+ uint32_t obj_num = 0;
+ ObjectInfo info;
+ };
+
CPDF_Object* ParseDirect(CPDF_Object* pObj);
bool LoadAllCrossRefV4(FX_FILESIZE pos);
bool LoadAllCrossRefV5(FX_FILESIZE pos);
@@ -169,6 +174,16 @@ class CPDF_Parser {
// the objects.
bool VerifyCrossRefV4();
+ // If out_objects is null, the parser position will be moved to end subsection
+ // without additional validation.
+ bool ParseAndAppendCrossRefSubsectionData(
+ uint32_t start_objnum,
+ uint32_t count,
+ std::vector<CrossRefObjData>* out_objects);
+ bool ParseCrossRefV4(std::vector<CrossRefObjData>* out_objects,
+ uint32_t* start_obj_num_at_last_block);
+ void MergeCrossRefObjectsData(const std::vector<CrossRefObjData>& objects);
+
CFX_UnownedPtr<CPDF_Document> m_pDocument;
bool m_bHasParsed;
bool m_bXRefStream;