From 06104a8abc71ecd824d6a461b6f6f31c32fd2135 Mon Sep 17 00:00:00 2001 From: tsepez Date: Mon, 21 Nov 2016 16:22:10 -0800 Subject: Remove some WrapUnique() calls by returing unique_ptrs Return these from underlying methods as appropriate. Review-Url: https://codereview.chromium.org/2520133002 --- core/fpdfapi/page/cpdf_streamcontentparser.h | 32 +++++++++++++++------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'core/fpdfapi/page/cpdf_streamcontentparser.h') diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.h b/core/fpdfapi/page/cpdf_streamcontentparser.h index 1ed2aaa4de..dfb5230809 100644 --- a/core/fpdfapi/page/cpdf_streamcontentparser.h +++ b/core/fpdfapi/page/cpdf_streamcontentparser.h @@ -52,21 +52,23 @@ class CPDF_StreamContentParser { private: struct ContentParam { enum Type { OBJECT = 0, NUMBER, NAME }; + + ContentParam(); + ~ContentParam(); + Type m_Type; - union { - struct { - bool m_bInteger; - union { - int m_Integer; - FX_FLOAT m_Float; - }; - } m_Number; - CPDF_Object* m_pObject; - struct { - int m_Len; - char m_Buffer[32]; - } m_Name; - }; + std::unique_ptr m_pObject; + struct { + bool m_bInteger; + union { + int m_Integer; + FX_FLOAT m_Float; + }; + } m_Number; + struct { + int m_Len; + char m_Buffer[32]; + } m_Name; }; static const int kParamBufSize = 16; @@ -76,7 +78,7 @@ class CPDF_StreamContentParser { static OpCodes InitializeOpCodes(); void AddNumberParam(const FX_CHAR* str, int len); - void AddObjectParam(CPDF_Object* pObj); + void AddObjectParam(std::unique_ptr pObj); void AddNameParam(const FX_CHAR* name, int size); int GetNextParamPos(); void ClearAllParams(); -- cgit v1.2.3