summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_parser.h
diff options
context:
space:
mode:
authorArtem Strygin <art-snake@yandex-team.ru>2018-07-25 02:28:35 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-07-25 02:28:35 +0000
commit70ddc1ca22ad44a77006491b604a75f6514a4aa8 (patch)
tree1aab47245a415069f425fac877fd361352fb2a27 /core/fpdfapi/parser/cpdf_parser.h
parent36b2059cae7fc851c9f35babd35ec82a7a5d9694 (diff)
downloadpdfium-70ddc1ca22ad44a77006491b604a75f6514a4aa8.tar.xz
Use document size instead of file size while parsing.
We should use document size instead of File size, because all offsets and sizes was read from document should take into account of header offset. Added some tests of parsing of documents with header offset. Also drop friendship of CPDF_SyntaxParser with CPDF_Parser. Change-Id: Iebec75ab2ee07fb644a6c653b4ef5c2e09af09fe Reviewed-on: https://pdfium-review.googlesource.com/35830 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_parser.h')
-rw-r--r--core/fpdfapi/parser/cpdf_parser.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/fpdfapi/parser/cpdf_parser.h b/core/fpdfapi/parser/cpdf_parser.h
index 0af39d7529..7cd98c2c26 100644
--- a/core/fpdfapi/parser/cpdf_parser.h
+++ b/core/fpdfapi/parser/cpdf_parser.h
@@ -90,7 +90,6 @@ class CPDF_Parser {
CPDF_SecurityHandler* GetSecurityHandler() const {
return m_pSecurityHandler.get();
}
- RetainPtr<IFX_SeekableReadStream> GetFileAccess() const;
bool IsObjectFree(uint32_t objnum) const;
int GetFileVersion() const { return m_FileVersion; }
@@ -109,6 +108,8 @@ class CPDF_Parser {
return m_CrossRefTable.get();
}
+ CPDF_SyntaxParser* GetSyntax() const { return m_pSyntax.get(); }
+
void SetLinearizedHeader(std::unique_ptr<CPDF_LinearizedHeader> pLinearized);
protected:
@@ -121,6 +122,9 @@ class CPDF_Parser {
bool RebuildCrossRef();
private:
+ friend class cpdf_parser_ParseStartXRefWithHeaderOffset_Test;
+ friend class cpdf_parser_ParseStartXRef_Test;
+ friend class cpdf_parser_ParseLinearizedWithHeaderOffset_Test;
friend class CPDF_DataAvail;
struct CrossRefObjData {