summaryrefslogtreecommitdiff
path: root/core/fxcodec/jbig2/JBig2_GrdProc.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-30 16:12:02 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-30 20:26:02 +0000
commit0bb1333a9eff1190ddd68f34c71d6a779c69dfef (patch)
tree5a46946c4852f147309e2b1389e6f42d6553abf7 /core/fxcodec/jbig2/JBig2_GrdProc.cpp
parent908c848202ef137e98d96f82a4eadfae551403b7 (diff)
downloadpdfium-0bb1333a9eff1190ddd68f34c71d6a779c69dfef.tar.xz
Add some calls to MakeUnique
This CL replaces some new's with pdfium::MakeUnique. Change-Id: I50faf3ed55e7730b094c14a7989a9dd51cf33cbb Reviewed-on: https://pdfium-review.googlesource.com/3430 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_GrdProc.cpp')
-rw-r--r--core/fxcodec/jbig2/JBig2_GrdProc.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/core/fxcodec/jbig2/JBig2_GrdProc.cpp b/core/fxcodec/jbig2/JBig2_GrdProc.cpp
index d5d4c6d0dc..675de9bcdd 100644
--- a/core/fxcodec/jbig2/JBig2_GrdProc.cpp
+++ b/core/fxcodec/jbig2/JBig2_GrdProc.cpp
@@ -12,6 +12,7 @@
#include "core/fxcodec/jbig2/JBig2_ArithDecoder.h"
#include "core/fxcodec/jbig2/JBig2_BitStream.h"
#include "core/fxcodec/jbig2/JBig2_Image.h"
+#include "third_party/base/ptr_util.h"
CJBig2_GRDProc::CJBig2_GRDProc()
: m_loopIndex(0),
@@ -65,7 +66,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder,
CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template0_opt3(
CJBig2_ArithDecoder* pArithDecoder,
JBig2ArithCtx* gbContext) {
- std::unique_ptr<CJBig2_Image> GBREG(new CJBig2_Image(GBW, GBH));
+ auto GBREG = pdfium::MakeUnique<CJBig2_Image>(GBW, GBH);
if (!GBREG->m_pData)
return nullptr;
@@ -164,7 +165,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template0_unopt(
CJBig2_ArithDecoder* pArithDecoder,
JBig2ArithCtx* gbContext) {
int LTP = 0;
- std::unique_ptr<CJBig2_Image> GBREG(new CJBig2_Image(GBW, GBH));
+ auto GBREG = pdfium::MakeUnique<CJBig2_Image>(GBW, GBH);
GBREG->fill(0);
for (uint32_t h = 0; h < GBH; h++) {
if (TPGDON) {
@@ -214,7 +215,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template0_unopt(
CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template1_opt3(
CJBig2_ArithDecoder* pArithDecoder,
JBig2ArithCtx* gbContext) {
- std::unique_ptr<CJBig2_Image> GBREG(new CJBig2_Image(GBW, GBH));
+ auto GBREG = pdfium::MakeUnique<CJBig2_Image>(GBW, GBH);
if (!GBREG->m_pData)
return nullptr;
@@ -312,7 +313,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template1_unopt(
CJBig2_ArithDecoder* pArithDecoder,
JBig2ArithCtx* gbContext) {
int LTP = 0;
- std::unique_ptr<CJBig2_Image> GBREG(new CJBig2_Image(GBW, GBH));
+ auto GBREG = pdfium::MakeUnique<CJBig2_Image>(GBW, GBH);
GBREG->fill(0);
for (uint32_t h = 0; h < GBH; h++) {
if (TPGDON) {
@@ -360,7 +361,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template1_unopt(
CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template2_opt3(
CJBig2_ArithDecoder* pArithDecoder,
JBig2ArithCtx* gbContext) {
- std::unique_ptr<CJBig2_Image> GBREG(new CJBig2_Image(GBW, GBH));
+ auto GBREG = pdfium::MakeUnique<CJBig2_Image>(GBW, GBH);
if (!GBREG->m_pData)
return nullptr;
@@ -458,7 +459,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template2_unopt(
CJBig2_ArithDecoder* pArithDecoder,
JBig2ArithCtx* gbContext) {
int LTP = 0;
- std::unique_ptr<CJBig2_Image> GBREG(new CJBig2_Image(GBW, GBH));
+ auto GBREG = pdfium::MakeUnique<CJBig2_Image>(GBW, GBH);
GBREG->fill(0);
for (uint32_t h = 0; h < GBH; h++) {
if (TPGDON) {
@@ -504,7 +505,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template2_unopt(
CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template3_opt3(
CJBig2_ArithDecoder* pArithDecoder,
JBig2ArithCtx* gbContext) {
- std::unique_ptr<CJBig2_Image> GBREG(new CJBig2_Image(GBW, GBH));
+ auto GBREG = pdfium::MakeUnique<CJBig2_Image>(GBW, GBH);
if (!GBREG->m_pData)
return nullptr;
@@ -590,7 +591,7 @@ CJBig2_Image* CJBig2_GRDProc::decode_Arith_Template3_unopt(
CJBig2_ArithDecoder* pArithDecoder,
JBig2ArithCtx* gbContext) {
int LTP = 0;
- std::unique_ptr<CJBig2_Image> GBREG(new CJBig2_Image(GBW, GBH));
+ auto GBREG = pdfium::MakeUnique<CJBig2_Image>(GBW, GBH);
GBREG->fill(0);
for (uint32_t h = 0; h < GBH; h++) {
if (TPGDON) {