From 06104a8abc71ecd824d6a461b6f6f31c32fd2135 Mon Sep 17 00:00:00 2001 From: tsepez Date: Mon, 21 Nov 2016 16:22:10 -0800 Subject: Remove some WrapUnique() calls by returing unique_ptrs Return these from underlying methods as appropriate. Review-Url: https://codereview.chromium.org/2520133002 --- core/fpdfapi/page/pageint.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'core/fpdfapi/page/pageint.h') diff --git a/core/fpdfapi/page/pageint.h b/core/fpdfapi/page/pageint.h index dee9639d7d..cf3522d44a 100644 --- a/core/fpdfapi/page/pageint.h +++ b/core/fpdfapi/page/pageint.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include "core/fpdfapi/page/cpdf_contentmark.h" @@ -52,16 +53,17 @@ class CPDF_StreamParser { const CFX_WeakPtr& pPool); ~CPDF_StreamParser(); - CPDF_Stream* ReadInlineStream(CPDF_Document* pDoc, - CPDF_Dictionary* pDict, - CPDF_Object* pCSObj); SyntaxType ParseNextElement(); uint8_t* GetWordBuf() { return m_WordBuffer; } uint32_t GetWordSize() const { return m_WordSize; } - CPDF_Object* GetObject(); uint32_t GetPos() const { return m_Pos; } void SetPos(uint32_t pos) { m_Pos = pos; } - CPDF_Object* ReadNextObject(bool bAllowNestedArray, uint32_t dwInArrayLevel); + std::unique_ptr GetObject() { return std::move(m_pLastObj); } + std::unique_ptr ReadNextObject(bool bAllowNestedArray, + uint32_t dwInArrayLevel); + std::unique_ptr ReadInlineStream(CPDF_Document* pDoc, + CPDF_Dictionary* pDict, + CPDF_Object* pCSObj); private: friend class cpdf_streamparser_ReadHexString_Test; @@ -76,7 +78,7 @@ class CPDF_StreamParser { uint32_t m_Pos; // Current byte position within m_pBuf. uint8_t m_WordBuffer[256]; uint32_t m_WordSize; - CPDF_Object* m_pLastObj; + std::unique_ptr m_pLastObj; CFX_WeakPtr m_pPool; }; -- cgit v1.2.3