diff options
author | dsinclair <dsinclair@chromium.org> | 2016-04-12 11:21:22 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-12 11:21:23 -0700 |
commit | d55e11eeb8ebf1e226a1166f395ba77248ce84c3 (patch) | |
tree | c28b1c1d6ac1597e569618cdeb02e3e0009bf8ed /core/fxcodec/codec/fx_codec.cpp | |
parent | ea98238666e33cd16b69cb23dcaca047c21c9998 (diff) | |
download | pdfium-d55e11eeb8ebf1e226a1166f395ba77248ce84c3.tar.xz |
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
Diffstat (limited to 'core/fxcodec/codec/fx_codec.cpp')
-rw-r--r-- | core/fxcodec/codec/fx_codec.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
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 <cmath> +#include <memory> #include <utility> #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<CCodec_RLScanlineDecoder> 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(); } |