From 3cfe89d632315b6bdae3264cc75fc5ed06d36f45 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 21 Aug 2018 20:55:17 +0000 Subject: Use UnownedPtr<> in CJBig2_TRDProc. First real use case of assigning Unowned to MaybeOwned. Change-Id: Ia5bc7102012f7a09120ba02d38cf751547d5c005 Reviewed-on: https://pdfium-review.googlesource.com/40914 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- core/fxcodec/jbig2/JBig2_TrdProc.cpp | 8 ++++++-- core/fxcodec/jbig2/JBig2_TrdProc.h | 24 ++++++++++++++---------- 2 files changed, 20 insertions(+), 12 deletions(-) (limited to 'core') diff --git a/core/fxcodec/jbig2/JBig2_TrdProc.cpp b/core/fxcodec/jbig2/JBig2_TrdProc.cpp index 79b2142a9f..4f082f376f 100644 --- a/core/fxcodec/jbig2/JBig2_TrdProc.cpp +++ b/core/fxcodec/jbig2/JBig2_TrdProc.cpp @@ -39,9 +39,13 @@ Optional CheckTRDReferenceDimension(int32_t dimension, } // namespace -CJBig2_TRDProc::CJBig2_TRDProc() {} +JBig2IntDecoderState::JBig2IntDecoderState() = default; -CJBig2_TRDProc::~CJBig2_TRDProc() {} +JBig2IntDecoderState::~JBig2IntDecoderState() = default; + +CJBig2_TRDProc::CJBig2_TRDProc() = default; + +CJBig2_TRDProc::~CJBig2_TRDProc() = default; std::unique_ptr CJBig2_TRDProc::DecodeHuffman( CJBig2_BitStream* pStream, diff --git a/core/fxcodec/jbig2/JBig2_TrdProc.h b/core/fxcodec/jbig2/JBig2_TrdProc.h index 1d90bf4bd6..52c5322ec4 100644 --- a/core/fxcodec/jbig2/JBig2_TrdProc.h +++ b/core/fxcodec/jbig2/JBig2_TrdProc.h @@ -12,6 +12,7 @@ #include "core/fxcodec/jbig2/JBig2_Image.h" #include "core/fxcrt/fx_system.h" +#include "core/fxcrt/unowned_ptr.h" class CJBig2_ArithDecoder; class CJBig2_ArithIaidDecoder; @@ -22,16 +23,19 @@ struct JBig2ArithCtx; struct JBig2HuffmanCode; struct JBig2IntDecoderState { - CJBig2_ArithIntDecoder* IADT; - CJBig2_ArithIntDecoder* IAFS; - CJBig2_ArithIntDecoder* IADS; - CJBig2_ArithIntDecoder* IAIT; - CJBig2_ArithIntDecoder* IARI; - CJBig2_ArithIntDecoder* IARDW; - CJBig2_ArithIntDecoder* IARDH; - CJBig2_ArithIntDecoder* IARDX; - CJBig2_ArithIntDecoder* IARDY; - CJBig2_ArithIaidDecoder* IAID; + JBig2IntDecoderState(); + ~JBig2IntDecoderState(); + + UnownedPtr IADT; + UnownedPtr IAFS; + UnownedPtr IADS; + UnownedPtr IAIT; + UnownedPtr IARI; + UnownedPtr IARDW; + UnownedPtr IARDH; + UnownedPtr IARDX; + UnownedPtr IARDY; + UnownedPtr IAID; }; enum JBig2Corner { -- cgit v1.2.3