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 --- xfa/fgas/crt/fgas_stream.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'xfa/fgas/crt/fgas_stream.h') diff --git a/xfa/fgas/crt/fgas_stream.h b/xfa/fgas/crt/fgas_stream.h index bd065ff308..b6552d9825 100644 --- a/xfa/fgas/crt/fgas_stream.h +++ b/xfa/fgas/crt/fgas_stream.h @@ -7,6 +7,7 @@ #ifndef XFA_FGAS_CRT_FGAS_STREAM_H_ #define XFA_FGAS_CRT_FGAS_STREAM_H_ +#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_stream.h" #include "core/fxcrt/fx_system.h" @@ -28,10 +29,12 @@ enum FX_STREAMSEEK { class IFGAS_Stream { public: - static IFGAS_Stream* CreateStream(IFX_SeekableReadStream* pFileRead, - uint32_t dwAccess); - static IFGAS_Stream* CreateStream(IFX_SeekableWriteStream* pFileWrite, - uint32_t dwAccess); + static IFGAS_Stream* CreateStream( + const CFX_RetainPtr& pFileRead, + uint32_t dwAccess); + static IFGAS_Stream* CreateStream( + const CFX_RetainPtr& pFileWrite, + uint32_t dwAccess); static IFGAS_Stream* CreateStream(uint8_t* pData, int32_t length, uint32_t dwAccess); @@ -63,7 +66,7 @@ class IFGAS_Stream { virtual uint16_t GetCodePage() const = 0; virtual uint16_t SetCodePage(uint16_t wCodePage) = 0; - IFX_SeekableReadStream* MakeSeekableReadStream(); + CFX_RetainPtr MakeSeekableReadStream(); }; -- cgit v1.2.3