diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-03-30 16:12:02 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-03-30 20:26:02 +0000 |
commit | 0bb1333a9eff1190ddd68f34c71d6a779c69dfef (patch) | |
tree | 5a46946c4852f147309e2b1389e6f42d6553abf7 /core/fxcodec/jbig2/JBig2_PddProc.cpp | |
parent | 908c848202ef137e98d96f82a4eadfae551403b7 (diff) | |
download | pdfium-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_PddProc.cpp')
-rw-r--r-- | core/fxcodec/jbig2/JBig2_PddProc.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/fxcodec/jbig2/JBig2_PddProc.cpp b/core/fxcodec/jbig2/JBig2_PddProc.cpp index 679a87a036..3eef302baf 100644 --- a/core/fxcodec/jbig2/JBig2_PddProc.cpp +++ b/core/fxcodec/jbig2/JBig2_PddProc.cpp @@ -11,6 +11,7 @@ #include "core/fxcodec/jbig2/JBig2_GrdProc.h" #include "core/fxcodec/jbig2/JBig2_Image.h" #include "core/fxcodec/jbig2/JBig2_PatternDict.h" +#include "third_party/base/ptr_util.h" CJBig2_PatternDict* CJBig2_PDDProc::decode_Arith( CJBig2_ArithDecoder* pArithDecoder, @@ -18,12 +19,12 @@ CJBig2_PatternDict* CJBig2_PDDProc::decode_Arith( IFX_Pause* pPause) { uint32_t GRAY; CJBig2_Image* BHDC = nullptr; - std::unique_ptr<CJBig2_PatternDict> pDict(new CJBig2_PatternDict()); + auto pDict = pdfium::MakeUnique<CJBig2_PatternDict>(); pDict->NUMPATS = GRAYMAX + 1; pDict->HDPATS = FX_Alloc(CJBig2_Image*, pDict->NUMPATS); JBIG2_memset(pDict->HDPATS, 0, sizeof(CJBig2_Image*) * pDict->NUMPATS); - std::unique_ptr<CJBig2_GRDProc> pGRD(new CJBig2_GRDProc()); + auto pGRD = pdfium::MakeUnique<CJBig2_GRDProc>(); pGRD->MMR = HDMMR; pGRD->GBW = (GRAYMAX + 1) * HDPW; pGRD->GBH = HDPH; @@ -60,12 +61,12 @@ CJBig2_PatternDict* CJBig2_PDDProc::decode_MMR(CJBig2_BitStream* pStream, IFX_Pause* pPause) { uint32_t GRAY; CJBig2_Image* BHDC = nullptr; - std::unique_ptr<CJBig2_PatternDict> pDict(new CJBig2_PatternDict()); + auto pDict = pdfium::MakeUnique<CJBig2_PatternDict>(); pDict->NUMPATS = GRAYMAX + 1; pDict->HDPATS = FX_Alloc(CJBig2_Image*, pDict->NUMPATS); JBIG2_memset(pDict->HDPATS, 0, sizeof(CJBig2_Image*) * pDict->NUMPATS); - std::unique_ptr<CJBig2_GRDProc> pGRD(new CJBig2_GRDProc()); + auto pGRD = pdfium::MakeUnique<CJBig2_GRDProc>(); pGRD->MMR = HDMMR; pGRD->GBW = (GRAYMAX + 1) * HDPW; pGRD->GBH = HDPH; |