summaryrefslogtreecommitdiff
path: root/core/fxcodec/codec/ccodec_bmpmodule.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-09-25 20:06:50 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-09-25 20:06:50 +0000
commit958142efa4561b5efd52733ad6c3b889cf49b3ae (patch)
treeda605e08bceccbae3e23d87471c197b37ac48e28 /core/fxcodec/codec/ccodec_bmpmodule.cpp
parentfed6e124109f089a38e24e37b104d983231bee78 (diff)
downloadpdfium-958142efa4561b5efd52733ad6c3b889cf49b3ae.tar.xz
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 <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcodec/codec/ccodec_bmpmodule.cpp')
-rw-r--r--core/fxcodec/codec/ccodec_bmpmodule.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/fxcodec/codec/ccodec_bmpmodule.cpp b/core/fxcodec/codec/ccodec_bmpmodule.cpp
index ff4164ce4f..9884662bd3 100644
--- a/core/fxcodec/codec/ccodec_bmpmodule.cpp
+++ b/core/fxcodec/codec/ccodec_bmpmodule.cpp
@@ -17,7 +17,7 @@ CCodec_BmpModule::CCodec_BmpModule() {}
CCodec_BmpModule::~CCodec_BmpModule() {}
-std::unique_ptr<CCodec_BmpModule::Context> CCodec_BmpModule::Start(
+std::unique_ptr<CodecModuleIface::Context> CCodec_BmpModule::Start(
Delegate* pDelegate) {
auto p = pdfium::MakeUnique<CFX_BmpContext>(this, pDelegate);
p->m_Bmp.context_ptr_ = p.get();
@@ -67,6 +67,9 @@ FX_FILESIZE CCodec_BmpModule::GetAvailInput(Context* pContext) const {
return static_cast<CFX_BmpContext*>(pContext)->m_Bmp.GetAvailInput();
}
-void CCodec_BmpModule::Input(Context* pContext, pdfium::span<uint8_t> src_buf) {
+bool CCodec_BmpModule::Input(Context* pContext,
+ pdfium::span<uint8_t> src_buf,
+ CFX_DIBAttribute*) {
static_cast<CFX_BmpContext*>(pContext)->m_Bmp.SetInputBuffer(src_buf);
+ return true;
}