From 833619b4441915c7c55085d44b3221eaef0d9800 Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 7 Dec 2016 09:21:17 -0800 Subject: Refcount all the IFX_ stream classes all the time. We can remove a lot of "bOwnsStream" logic in the process. Always pass these by const reference, in case the called method wants to hang on to the stream (one exception is where we stick a raw pointer into a void* slot in a context from another layer). Review-Url: https://codereview.chromium.org/2451493002 --- core/fpdfapi/parser/cpdf_syntax_parser.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core/fpdfapi/parser/cpdf_syntax_parser.h') diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.h b/core/fpdfapi/parser/cpdf_syntax_parser.h index 1e8f736c17..8dd9103f1b 100644 --- a/core/fpdfapi/parser/cpdf_syntax_parser.h +++ b/core/fpdfapi/parser/cpdf_syntax_parser.h @@ -26,7 +26,9 @@ class CPDF_SyntaxParser { explicit CPDF_SyntaxParser(const CFX_WeakPtr& pPool); ~CPDF_SyntaxParser(); - void InitParser(IFX_SeekableReadStream* pFileAccess, uint32_t HeaderOffset); + void InitParser(const CFX_RetainPtr& pFileAccess, + uint32_t HeaderOffset); + FX_FILESIZE SavePos() const { return m_Pos; } void RestorePos(FX_FILESIZE pos) { m_Pos = pos; } @@ -87,7 +89,7 @@ class CPDF_SyntaxParser { FX_FILESIZE m_Pos; uint32_t m_MetadataObjnum; - IFX_SeekableReadStream* m_pFileAccess; + CFX_RetainPtr m_pFileAccess; FX_FILESIZE m_HeaderOffset; FX_FILESIZE m_FileLen; uint8_t* m_pFileBuf; -- cgit v1.2.3