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/fxcodec/codec/ccodec_progressivedecoder.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'core/fxcodec/codec/ccodec_progressivedecoder.h') diff --git a/core/fxcodec/codec/ccodec_progressivedecoder.h b/core/fxcodec/codec/ccodec_progressivedecoder.h index de7542e485..614146f79d 100644 --- a/core/fxcodec/codec/ccodec_progressivedecoder.h +++ b/core/fxcodec/codec/ccodec_progressivedecoder.h @@ -10,6 +10,7 @@ #include #include "core/fxcodec/fx_codec_def.h" +#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_system.h" #include "core/fxge/fx_dib.h" @@ -45,10 +46,11 @@ class CCodec_ProgressiveDecoder { explicit CCodec_ProgressiveDecoder(CCodec_ModuleMgr* pCodecMgr); ~CCodec_ProgressiveDecoder(); - FXCODEC_STATUS LoadImageInfo(IFX_SeekableReadStream* pFile, - FXCODEC_IMAGE_TYPE imageType, - CFX_DIBAttribute* pAttribute, - bool bSkipImageTypeCheck); + FXCODEC_STATUS LoadImageInfo( + const CFX_RetainPtr& pFile, + FXCODEC_IMAGE_TYPE imageType, + CFX_DIBAttribute* pAttribute, + bool bSkipImageTypeCheck); FXCODEC_IMAGE_TYPE GetType() const { return m_imagType; } int32_t GetWidth() const { return m_SrcWidth; } @@ -125,7 +127,7 @@ class CCodec_ProgressiveDecoder { std::vector m_pWeightTables; }; - IFX_SeekableReadStream* m_pFile; + CFX_RetainPtr m_pFile; CCodec_ModuleMgr* m_pCodecMgr; FXJPEG_Context* m_pJpegContext; FXPNG_Context* m_pPngContext; -- cgit v1.2.3