From 698c5716d005860360527e4cfe15b4a185589117 Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 28 Sep 2016 16:47:07 -0700 Subject: Use string pools in some dictionaries, names, and strings. BUG=pdfium:597 Review-Url: https://codereview.chromium.org/2345063002 --- core/fpdfapi/fpdf_page/pageint.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'core/fpdfapi/fpdf_page/pageint.h') diff --git a/core/fpdfapi/fpdf_page/pageint.h b/core/fpdfapi/fpdf_page/pageint.h index 427a363e8e..c5b80aa550 100644 --- a/core/fpdfapi/fpdf_page/pageint.h +++ b/core/fpdfapi/fpdf_page/pageint.h @@ -16,6 +16,8 @@ #include "core/fpdfapi/fpdf_page/cpdf_contentmark.h" #include "core/fpdfapi/fpdf_page/cpdf_countedobject.h" #include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h" +#include "core/fxcrt/include/cfx_string_pool_template.h" +#include "core/fxcrt/include/cfx_weak_ptr.h" #include "core/fxge/include/cfx_pathdata.h" #include "core/fxge/include/cfx_renderdevice.h" @@ -43,6 +45,9 @@ class CPDF_StreamParser { enum SyntaxType { EndOfData, Number, Keyword, Name, Others }; CPDF_StreamParser(const uint8_t* pData, uint32_t dwSize); + CPDF_StreamParser(const uint8_t* pData, + uint32_t dwSize, + const CFX_WeakPtr& pPool); ~CPDF_StreamParser(); CPDF_Stream* ReadInlineStream(CPDF_Document* pDoc, @@ -66,17 +71,14 @@ class CPDF_StreamParser { void GetNextWord(FX_BOOL& bIsNumber); CFX_ByteString ReadString(); CFX_ByteString ReadHexString(); - const uint8_t* m_pBuf; - - // Length in bytes of m_pBuf. - uint32_t m_Size; - - // Current byte position within m_pBuf. - uint32_t m_Pos; + const uint8_t* m_pBuf; + uint32_t m_Size; // Length in bytes of m_pBuf. + uint32_t m_Pos; // Current byte position within m_pBuf. uint8_t m_WordBuffer[256]; uint32_t m_WordSize; CPDF_Object* m_pLastObj; + CFX_WeakPtr m_pPool; private: bool PositionIsInBounds() const; -- cgit v1.2.3