From 5171a27eaa7489939310bd2864864867cc78ce21 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 1 Jun 2017 12:29:09 -0700 Subject: Use unique_ptrs for codec contexts in ccodec_progressivedecoder. Change-Id: I4deaf8ca946c2dcb6842c5702b02eed1c22b1201 Reviewed-on: https://pdfium-review.googlesource.com/6191 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- core/fxcodec/codec/ccodec_pngmodule.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'core/fxcodec/codec/ccodec_pngmodule.h') diff --git a/core/fxcodec/codec/ccodec_pngmodule.h b/core/fxcodec/codec/ccodec_pngmodule.h index b92e09cc71..121e646a86 100644 --- a/core/fxcodec/codec/ccodec_pngmodule.h +++ b/core/fxcodec/codec/ccodec_pngmodule.h @@ -7,14 +7,19 @@ #ifndef CORE_FXCODEC_CODEC_CCODEC_PNGMODULE_H_ #define CORE_FXCODEC_CODEC_CCODEC_PNGMODULE_H_ -#include "core/fxcrt/cfx_unowned_ptr.h" +#include + #include "core/fxcrt/fx_system.h" class CFX_DIBAttribute; class CCodec_PngModule { public: - class Context; + class Context { + public: + virtual ~Context() {} + }; + class Delegate { public: virtual bool PngReadHeader(int width, @@ -27,8 +32,7 @@ class CCodec_PngModule { virtual void PngFillScanlineBufCompleted(int pass, int line) = 0; }; - Context* Start(Delegate* pDelegate); - void Finish(Context* pContext); + std::unique_ptr Start(Delegate* pDelegate); bool Input(Context* pContext, const uint8_t* src_buf, uint32_t src_size, -- cgit v1.2.3