From d55e11eeb8ebf1e226a1166f395ba77248ce84c3 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Tue, 12 Apr 2016 11:21:22 -0700 Subject: Remove ICodec_* Interfaces. All of the ICodec_* interfaces had a single implementation. This CL removes the interfaces and uses the concrete classes in their place. BUG=pdfium:468 Review URL: https://codereview.chromium.org/1876023003 --- core/fxcodec/codec/fx_codec.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'core/fxcodec/codec/fx_codec.cpp') diff --git a/core/fxcodec/codec/fx_codec.cpp b/core/fxcodec/codec/fx_codec.cpp index 77dd363c9d..a0356929a5 100644 --- a/core/fxcodec/codec/fx_codec.cpp +++ b/core/fxcodec/codec/fx_codec.cpp @@ -7,6 +7,7 @@ #include "core/fxcodec/include/fx_codec.h" #include +#include #include #include "core/fxcodec/codec/codec_int.h" @@ -397,18 +398,20 @@ void CCodec_RLScanlineDecoder::UpdateOperator(uint8_t used_bytes) { count -= used_bytes; m_Operator = 257 - count; } -ICodec_ScanlineDecoder* CCodec_BasicModule::CreateRunLengthDecoder( + +CCodec_ScanlineDecoder* CCodec_BasicModule::CreateRunLengthDecoder( const uint8_t* src_buf, uint32_t src_size, int width, int height, int nComps, int bpc) { - CCodec_RLScanlineDecoder* pRLScanlineDecoder = new CCodec_RLScanlineDecoder; + std::unique_ptr pRLScanlineDecoder( + new CCodec_RLScanlineDecoder); if (!pRLScanlineDecoder->Create(src_buf, src_size, width, height, nComps, bpc)) { - delete pRLScanlineDecoder; - return NULL; + return nullptr; } - return pRLScanlineDecoder; + + return pRLScanlineDecoder.release(); } -- cgit v1.2.3