From 958142efa4561b5efd52733ad6c3b889cf49b3ae Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 25 Sep 2018 20:06:50 +0000 Subject: Introduce CodecModuleIface for progressive decoder modules. Another step before trying to fix the memory issue. Forces common APIs on the bunch of decoders, though some methods are unused. Requires adding some arguments/return values to get to a common API which are not used in all cases (yet?). Required converting some args to spans. Required proxying a GetJumpMark() call through the public module API to the private context. Bug: pdfium:1082 Change-Id: I0c0b7415141ff2a6f4f44777ca3d05521f08130d Reviewed-on: https://pdfium-review.googlesource.com/41950 Commit-Queue: Lei Zhang Reviewed-by: Lei Zhang --- core/fxcodec/codec/ccodec_gifmodule.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'core/fxcodec/codec/ccodec_gifmodule.cpp') diff --git a/core/fxcodec/codec/ccodec_gifmodule.cpp b/core/fxcodec/codec/ccodec_gifmodule.cpp index a93cb27674..289993c903 100644 --- a/core/fxcodec/codec/ccodec_gifmodule.cpp +++ b/core/fxcodec/codec/ccodec_gifmodule.cpp @@ -17,7 +17,7 @@ CCodec_GifModule::CCodec_GifModule() {} CCodec_GifModule::~CCodec_GifModule() {} -std::unique_ptr CCodec_GifModule::Start( +std::unique_ptr CCodec_GifModule::Start( Delegate* pDelegate) { return pdfium::MakeUnique(this, pDelegate); } @@ -66,10 +66,13 @@ CFX_GifDecodeStatus CCodec_GifModule::LoadFrame(Context* pContext, return CFX_GifDecodeStatus::Success; } -uint32_t CCodec_GifModule::GetAvailInput(Context* pContext) const { +FX_FILESIZE CCodec_GifModule::GetAvailInput(Context* pContext) const { return static_cast(pContext)->GetAvailInput(); } -void CCodec_GifModule::Input(Context* pContext, pdfium::span src_buf) { +bool CCodec_GifModule::Input(Context* pContext, + pdfium::span src_buf, + CFX_DIBAttribute*) { static_cast(pContext)->SetInputBuffer(src_buf); + return true; } -- cgit v1.2.3