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_tiffmodule.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'core/fxcodec/codec/ccodec_tiffmodule.cpp') diff --git a/core/fxcodec/codec/ccodec_tiffmodule.cpp b/core/fxcodec/codec/ccodec_tiffmodule.cpp index 78f631cba9..d2c6c26dc0 100644 --- a/core/fxcodec/codec/ccodec_tiffmodule.cpp +++ b/core/fxcodec/codec/ccodec_tiffmodule.cpp @@ -32,7 +32,7 @@ struct TiffDeleter { } // namespace -class CTiffContext final : public CCodec_TiffModule::Context { +class CTiffContext final : public CodecModuleIface::Context { public: CTiffContext() = default; ~CTiffContext() override = default; @@ -487,7 +487,7 @@ bool CTiffContext::Decode(const RetainPtr& pDIBitmap) { return false; } -std::unique_ptr CCodec_TiffModule::CreateDecoder( +std::unique_ptr CCodec_TiffModule::CreateDecoder( const RetainPtr& file_ptr) { auto pDecoder = pdfium::MakeUnique(); if (!pDecoder->InitDecoder(file_ptr)) @@ -496,6 +496,18 @@ std::unique_ptr CCodec_TiffModule::CreateDecoder( return pDecoder; } +FX_FILESIZE CCodec_TiffModule::GetAvailInput(Context* pContext) const { + NOTREACHED(); + return 0; +} + +bool CCodec_TiffModule::Input(Context* pContext, + pdfium::span src_buf, + CFX_DIBAttribute*) { + NOTREACHED(); + return false; +} + bool CCodec_TiffModule::LoadFrameInfo(Context* pContext, int32_t frame, int32_t* width, -- cgit v1.2.3