diff options
author | Tom Sepez <tsepez@chromium.org> | 2017-06-01 12:29:09 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-06-01 20:14:44 +0000 |
commit | 5171a27eaa7489939310bd2864864867cc78ce21 (patch) | |
tree | 3c4a0cf4a4d4296ddc2c92c39850a5821f21e5cd /core/fxcodec/codec/ccodec_bmpmodule.h | |
parent | 5f34d479d06ebab9079c2d0704dee872cc45dd86 (diff) | |
download | pdfium-5171a27eaa7489939310bd2864864867cc78ce21.tar.xz |
Use unique_ptrs for codec contexts in ccodec_progressivedecoder.chromium/3118
Change-Id: I4deaf8ca946c2dcb6842c5702b02eed1c22b1201
Reviewed-on: https://pdfium-review.googlesource.com/6191
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxcodec/codec/ccodec_bmpmodule.h')
-rw-r--r-- | core/fxcodec/codec/ccodec_bmpmodule.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/core/fxcodec/codec/ccodec_bmpmodule.h b/core/fxcodec/codec/ccodec_bmpmodule.h index 7893fba4c7..10bc6b714e 100644 --- a/core/fxcodec/codec/ccodec_bmpmodule.h +++ b/core/fxcodec/codec/ccodec_bmpmodule.h @@ -7,6 +7,8 @@ #ifndef CORE_FXCODEC_CODEC_CCODEC_BMPMODULE_H_ #define CORE_FXCODEC_CODEC_CCODEC_BMPMODULE_H_ +#include <memory> + #include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_system.h" @@ -14,7 +16,11 @@ class CFX_DIBAttribute; class CCodec_BmpModule { public: - class Context; + class Context { + public: + virtual ~Context() {} + }; + class Delegate { public: virtual bool BmpInputImagePositionBuf(uint32_t rcd_pos) = 0; @@ -24,8 +30,7 @@ class CCodec_BmpModule { CCodec_BmpModule(); ~CCodec_BmpModule(); - Context* Start(Delegate* pDelegate); - void Finish(Context* pContext); + std::unique_ptr<Context> Start(Delegate* pDelegate); uint32_t GetAvailInput(Context* pContext, uint8_t** avail_buf_ptr); void Input(Context* pContext, const uint8_t* src_buf, uint32_t src_size); int32_t ReadHeader(Context* pContext, |