Chromium Code Reviews| Index: core/fpdfapi/page/cpdf_streamcontentparser.h |
| diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.h b/core/fpdfapi/page/cpdf_streamcontentparser.h |
| index 1ed2aaa4de9b116672edf3cfc8f537898c0d615d..e38e949493ae6d19b5663d9ecc60d4e0c290342f 100644 |
| --- a/core/fpdfapi/page/cpdf_streamcontentparser.h |
| +++ b/core/fpdfapi/page/cpdf_streamcontentparser.h |
| @@ -53,20 +53,18 @@ class CPDF_StreamContentParser { |
| struct ContentParam { |
| enum Type { OBJECT = 0, NUMBER, NAME }; |
| 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<CPDF_Object> m_pObject; |
|
Tom Sepez
2016/11/21 22:11:14
note: made this into a struct rather than a union,
|
| + 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 +74,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<CPDF_Object> pObj); |
| void AddNameParam(const FX_CHAR* name, int size); |
| int GetNextParamPos(); |
| void ClearAllParams(); |