diff options
author | Artem Strygin <art-snake@yandex-team.ru> | 2018-06-26 17:02:48 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-06-26 17:02:48 +0000 |
commit | 0145b89ac060870dd70f3d2f41f318a68721a086 (patch) | |
tree | d043f5d5f6992c08869f0edcd901d5232774937f /core/fpdfapi/parser/cpdf_syntax_parser.h | |
parent | 2d868435f4c0d47ded1ea405ad2af6b9d83b6651 (diff) | |
download | pdfium-0145b89ac060870dd70f3d2f41f318a68721a086.tar.xz |
Simplify CPDF_Parser::RebuildCrossRef.
Use CPDF_SyntaxParser to read data, instead manual cache.
Simplify merging trailers logic.
Change-Id: Icaa569f1082cde6dc9437a375c5c27e187fd6c79
Reviewed-on: https://pdfium-review.googlesource.com/35431
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_syntax_parser.h')
-rw-r--r-- | core/fpdfapi/parser/cpdf_syntax_parser.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.h b/core/fpdfapi/parser/cpdf_syntax_parser.h index ed760934b9..a8f6bb2033 100644 --- a/core/fpdfapi/parser/cpdf_syntax_parser.h +++ b/core/fpdfapi/parser/cpdf_syntax_parser.h @@ -11,6 +11,7 @@ #include <memory> #include <vector> +#include "core/fpdfapi/cpdf_modulemgr.h" #include "core/fxcrt/string_pool_template.h" #include "core/fxcrt/weak_ptr.h" @@ -35,6 +36,10 @@ class CPDF_SyntaxParser { void InitParserWithValidator(const RetainPtr<CPDF_ReadValidator>& pValidator, uint32_t HeaderOffset); + void SetReadBufferSize(uint32_t read_buffer_size) { + m_ReadBufferSize = read_buffer_size; + } + FX_FILESIZE GetPos() const { return m_Pos; } void SetPos(FX_FILESIZE pos) { m_Pos = std::min(pos, m_FileLen); } @@ -61,6 +66,7 @@ class CPDF_SyntaxParser { return m_pFileAccess; } uint32_t GetDirectNum(); + bool GetNextChar(uint8_t& ch); private: friend class CPDF_Parser; @@ -71,7 +77,6 @@ class CPDF_SyntaxParser { static int s_CurrentRecursionDepth; bool ReadBlockAt(FX_FILESIZE read_pos); - bool GetNextChar(uint8_t& ch); bool GetCharAtBackward(FX_FILESIZE pos, uint8_t* ch); void GetNextWordInternal(bool* bIsNumber); bool IsWholeWord(FX_FILESIZE startpos, @@ -100,6 +105,7 @@ class CPDF_SyntaxParser { FX_FILESIZE m_BufOffset; uint32_t m_WordSize; uint8_t m_WordBuffer[257]; + uint32_t m_ReadBufferSize = CPDF_ModuleMgr::kFileBufSize; }; #endif // CORE_FPDFAPI_PARSER_CPDF_SYNTAX_PARSER_H_ |