summaryrefslogtreecommitdiff
path: root/core/fxcodec/jbig2/JBig2_TrdProc.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-12-14 05:57:10 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-14 05:57:10 -0800
commita9caab94c1f16929e5acf2676117224617d80f53 (patch)
treed71ff9a82fae6e6080deb76375f43056127b3ee2 /core/fxcodec/jbig2/JBig2_TrdProc.cpp
parent992ecf7c189e5cabf43e5ad862511cf63d030966 (diff)
downloadpdfium-a9caab94c1f16929e5acf2676117224617d80f53.tar.xz
Avoid the ptr.reset(new XXX()) anti-pattern
Be suspicious of |new|. This removes some of the easy cases. Review-Url: https://codereview.chromium.org/2571913002
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_TrdProc.cpp')
-rw-r--r--core/fxcodec/jbig2/JBig2_TrdProc.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/core/fxcodec/jbig2/JBig2_TrdProc.cpp b/core/fxcodec/jbig2/JBig2_TrdProc.cpp
index 1fa4373d79..84042dbd8c 100644
--- a/core/fxcodec/jbig2/JBig2_TrdProc.cpp
+++ b/core/fxcodec/jbig2/JBig2_TrdProc.cpp
@@ -12,6 +12,7 @@
#include "core/fxcodec/jbig2/JBig2_ArithIntDecoder.h"
#include "core/fxcodec/jbig2/JBig2_GrrdProc.h"
#include "core/fxcodec/jbig2/JBig2_HuffmanDecoder.h"
+#include "third_party/base/ptr_util.h"
CJBig2_Image* CJBig2_TRDProc::decode_Huffman(CJBig2_BitStream* pStream,
JBig2ArithCtx* grContext) {
@@ -242,16 +243,16 @@ CJBig2_Image* CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder,
pIARDY = pIDS->IARDY;
pIAID = pIDS->IAID;
} else {
- IADT.reset(new CJBig2_ArithIntDecoder());
- IAFS.reset(new CJBig2_ArithIntDecoder());
- IADS.reset(new CJBig2_ArithIntDecoder());
- IAIT.reset(new CJBig2_ArithIntDecoder());
- IARI.reset(new CJBig2_ArithIntDecoder());
- IARDW.reset(new CJBig2_ArithIntDecoder());
- IARDH.reset(new CJBig2_ArithIntDecoder());
- IARDX.reset(new CJBig2_ArithIntDecoder());
- IARDY.reset(new CJBig2_ArithIntDecoder());
- IAID.reset(new CJBig2_ArithIaidDecoder(SBSYMCODELEN));
+ IADT = pdfium::MakeUnique<CJBig2_ArithIntDecoder>();
+ IAFS = pdfium::MakeUnique<CJBig2_ArithIntDecoder>();
+ IADS = pdfium::MakeUnique<CJBig2_ArithIntDecoder>();
+ IAIT = pdfium::MakeUnique<CJBig2_ArithIntDecoder>();
+ IARI = pdfium::MakeUnique<CJBig2_ArithIntDecoder>();
+ IARDW = pdfium::MakeUnique<CJBig2_ArithIntDecoder>();
+ IARDH = pdfium::MakeUnique<CJBig2_ArithIntDecoder>();
+ IARDX = pdfium::MakeUnique<CJBig2_ArithIntDecoder>();
+ IARDY = pdfium::MakeUnique<CJBig2_ArithIntDecoder>();
+ IAID = pdfium::MakeUnique<CJBig2_ArithIaidDecoder>(SBSYMCODELEN);
pIADT = IADT.get();
pIAFS = IAFS.get();
pIADS = IADS.get();