From b4d1b576bccb5ca6cebe29288af014bd0f512af1 Mon Sep 17 00:00:00 2001 From: weili Date: Wed, 10 Aug 2016 14:50:48 -0700 Subject: Use smart pointers for class owned pointers in xfa/fxfa Use smart pointers instead of raw pointer to make memory management easier for classes mainly under xfa/fxfa. Also change the return type of IFGAS_FontMgr::Create() to smart pointer type. BUG=pdfium:518 Review-Url: https://codereview.chromium.org/2227883002 --- xfa/fxfa/parser/xfa_locale.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'xfa/fxfa/parser/xfa_locale.h') diff --git a/xfa/fxfa/parser/xfa_locale.h b/xfa/fxfa/parser/xfa_locale.h index 0c72381cd5..0463a9f9e9 100644 --- a/xfa/fxfa/parser/xfa_locale.h +++ b/xfa/fxfa/parser/xfa_locale.h @@ -7,12 +7,14 @@ #ifndef XFA_FXFA_PARSER_XFA_LOCALE_H_ #define XFA_FXFA_PARSER_XFA_LOCALE_H_ +#include + #include "xfa/fgas/localization/fgas_locale.h" #include "xfa/fxfa/parser/xfa_object.h" class CXFA_XMLLocale : public IFX_Locale { public: - CXFA_XMLLocale(CXML_Element* pLocaleData); + explicit CXFA_XMLLocale(std::unique_ptr pLocaleData); // IFX_Locale void Release() override; @@ -51,7 +53,7 @@ class CXFA_XMLLocale : public IFX_Locale { FX_BOOL bAbbr) const; private: - CXML_Element* m_pLocaleData; + std::unique_ptr m_pLocaleData; }; class CXFA_NodeLocale : public IFX_Locale { @@ -94,7 +96,7 @@ class CXFA_NodeLocale : public IFX_Locale { int index, FX_BOOL bAbbr) const; - CXFA_Node* m_pLocale; + CXFA_Node* const m_pLocale; }; #endif // XFA_FXFA_PARSER_XFA_LOCALE_H_ -- cgit v1.2.3