diff options
author | Nicolas Pena <npm@chromium.org> | 2017-07-13 10:06:15 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-07-13 14:29:34 +0000 |
commit | 17453d03c3bdd18a893ae86058a6184939aee026 (patch) | |
tree | 2a87278c98e851744f20cd9aaa1460f849ef097e /core/fxcodec/jbig2/JBig2_GrdProc.h | |
parent | 360d1fce569b57aa2c487f6e171ba19b9dc8885e (diff) | |
download | pdfium-17453d03c3bdd18a893ae86058a6184939aee026.tar.xz |
More unique_ptrs in JBig2 code
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 <npm@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_GrdProc.h')
-rw-r--r-- | core/fxcodec/jbig2/JBig2_GrdProc.h | 52 |
1 files changed, 31 insertions, 21 deletions
diff --git a/core/fxcodec/jbig2/JBig2_GrdProc.h b/core/fxcodec/jbig2/JBig2_GrdProc.h index 3e4d3d403e..ef02a7d45a 100644 --- a/core/fxcodec/jbig2/JBig2_GrdProc.h +++ b/core/fxcodec/jbig2/JBig2_GrdProc.h @@ -7,6 +7,8 @@ #ifndef CORE_FXCODEC_JBIG2_JBIG2_GRDPROC_H_ #define CORE_FXCODEC_JBIG2_JBIG2_GRDPROC_H_ +#include <memory> + #include "core/fxcodec/fx_codec_def.h" #include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_coordinates.h" @@ -23,14 +25,14 @@ class CJBig2_GRDProc { CJBig2_GRDProc(); ~CJBig2_GRDProc(); - CJBig2_Image* decode_Arith(CJBig2_ArithDecoder* pArithDecoder, - JBig2ArithCtx* gbContext); + std::unique_ptr<CJBig2_Image> decode_Arith(CJBig2_ArithDecoder* pArithDecoder, + JBig2ArithCtx* gbContext); - FXCODEC_STATUS Start_decode_Arith(CJBig2_Image** pImage, + FXCODEC_STATUS Start_decode_Arith(std::unique_ptr<CJBig2_Image>* pImage, CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* gbContext, IFX_Pause* pPause); - FXCODEC_STATUS Start_decode_MMR(CJBig2_Image** pImage, + FXCODEC_STATUS Start_decode_MMR(std::unique_ptr<CJBig2_Image>* pImage, CJBig2_BitStream* pStream); FXCODEC_STATUS Continue_decode(IFX_Pause* pPause, CJBig2_ArithDecoder* pArithDecoder); @@ -88,34 +90,42 @@ class CJBig2_GRDProc { CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* gbContext, IFX_Pause* pPause); - CJBig2_Image* decode_Arith_Template0_opt3(CJBig2_ArithDecoder* pArithDecoder, - JBig2ArithCtx* gbContext); + std::unique_ptr<CJBig2_Image> decode_Arith_Template0_opt3( + CJBig2_ArithDecoder* pArithDecoder, + JBig2ArithCtx* gbContext); - CJBig2_Image* decode_Arith_Template0_unopt(CJBig2_ArithDecoder* pArithDecoder, - JBig2ArithCtx* gbContext); + std::unique_ptr<CJBig2_Image> decode_Arith_Template0_unopt( + CJBig2_ArithDecoder* pArithDecoder, + JBig2ArithCtx* gbContext); - CJBig2_Image* decode_Arith_Template1_opt3(CJBig2_ArithDecoder* pArithDecoder, - JBig2ArithCtx* gbContext); + std::unique_ptr<CJBig2_Image> decode_Arith_Template1_opt3( + CJBig2_ArithDecoder* pArithDecoder, + JBig2ArithCtx* gbContext); - CJBig2_Image* decode_Arith_Template1_unopt(CJBig2_ArithDecoder* pArithDecoder, - JBig2ArithCtx* gbContext); + std::unique_ptr<CJBig2_Image> decode_Arith_Template1_unopt( + CJBig2_ArithDecoder* pArithDecoder, + JBig2ArithCtx* gbContext); - CJBig2_Image* decode_Arith_Template2_opt3(CJBig2_ArithDecoder* pArithDecoder, - JBig2ArithCtx* gbContext); + std::unique_ptr<CJBig2_Image> decode_Arith_Template2_opt3( + CJBig2_ArithDecoder* pArithDecoder, + JBig2ArithCtx* gbContext); - CJBig2_Image* decode_Arith_Template2_unopt(CJBig2_ArithDecoder* pArithDecoder, - JBig2ArithCtx* gbContext); + std::unique_ptr<CJBig2_Image> decode_Arith_Template2_unopt( + CJBig2_ArithDecoder* pArithDecoder, + JBig2ArithCtx* gbContext); - CJBig2_Image* decode_Arith_Template3_opt3(CJBig2_ArithDecoder* pArithDecoder, - JBig2ArithCtx* gbContext); + std::unique_ptr<CJBig2_Image> decode_Arith_Template3_opt3( + CJBig2_ArithDecoder* pArithDecoder, + JBig2ArithCtx* gbContext); - CJBig2_Image* decode_Arith_Template3_unopt(CJBig2_ArithDecoder* pArithDecoder, - JBig2ArithCtx* gbContext); + std::unique_ptr<CJBig2_Image> decode_Arith_Template3_unopt( + CJBig2_ArithDecoder* pArithDecoder, + JBig2ArithCtx* gbContext); uint32_t m_loopIndex; uint8_t* m_pLine; FXCODEC_STATUS m_ProssiveStatus; - CJBig2_Image** m_pImage; + CJBig2_Image* m_pImage; JBig2ArithCtx* m_gbContext; uint16_t m_DecodeType; int m_LTP; |