From 17453d03c3bdd18a893ae86058a6184939aee026 Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Thu, 13 Jul 2017 10:06:15 -0400 Subject: More unique_ptrs in JBig2 code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL makes CJBig2_Segment own the results: symbol, pattern, huffman, and huffman. This causes a lot more unique_ptr usage in JBig2 code. Change-Id: I1f0a5bfaaf85053658b467bef5325c72d1f496c7 Reviewed-on: https://pdfium-review.googlesource.com/7690 Commit-Queue: Nicolás Peña Reviewed-by: Lei Zhang --- core/fxcodec/jbig2/JBig2_HtrdProc.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'core/fxcodec/jbig2/JBig2_HtrdProc.cpp') diff --git a/core/fxcodec/jbig2/JBig2_HtrdProc.cpp b/core/fxcodec/jbig2/JBig2_HtrdProc.cpp index 1e8710b417..f17e818588 100644 --- a/core/fxcodec/jbig2/JBig2_HtrdProc.cpp +++ b/core/fxcodec/jbig2/JBig2_HtrdProc.cpp @@ -6,15 +6,14 @@ #include "core/fxcodec/jbig2/JBig2_HtrdProc.h" -#include - #include "core/fxcodec/jbig2/JBig2_GsidProc.h" #include "core/fxcrt/fx_basic.h" #include "third_party/base/ptr_util.h" -CJBig2_Image* CJBig2_HTRDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder, - JBig2ArithCtx* gbContext, - IFX_Pause* pPause) { +std::unique_ptr CJBig2_HTRDProc::decode_Arith( + CJBig2_ArithDecoder* pArithDecoder, + JBig2ArithCtx* gbContext, + IFX_Pause* pPause) { uint32_t ng, mg; int32_t x, y; uint32_t HBPP; @@ -65,10 +64,11 @@ CJBig2_Image* CJBig2_HTRDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder, } } FX_Free(GI); - return HTREG.release(); + return HTREG; } -CJBig2_Image* CJBig2_HTRDProc::decode_MMR(CJBig2_BitStream* pStream) { +std::unique_ptr CJBig2_HTRDProc::decode_MMR( + CJBig2_BitStream* pStream) { uint32_t ng, mg; int32_t x, y; uint32_t* GI; @@ -100,5 +100,5 @@ CJBig2_Image* CJBig2_HTRDProc::decode_MMR(CJBig2_BitStream* pStream) { } } FX_Free(GI); - return HTREG.release(); + return HTREG; } -- cgit v1.2.3