Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: core/fxcodec/codec/fx_codec.cpp

Issue 1876023003: Remove ICodec_* Interfaces. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fxcodec/codec/codec_int.h ('k') | core/fxcodec/codec/fx_codec_bmp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcodec/codec/fx_codec.cpp
diff --git a/core/fxcodec/codec/fx_codec.cpp b/core/fxcodec/codec/fx_codec.cpp
index 77dd363c9db4ddbd4684ff75d67fc549edc95c62..a0356929a5fda0a04f057e134bb4d73876733225 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();
}
« no previous file with comments | « core/fxcodec/codec/codec_int.h ('k') | core/fxcodec/codec/fx_codec_bmp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698