diff options
author | weili <weili@chromium.org> | 2016-08-10 14:50:48 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-10 14:50:48 -0700 |
commit | b4d1b576bccb5ca6cebe29288af014bd0f512af1 (patch) | |
tree | 2d60839a8323eb6780c782aba4ae1123243c7355 /xfa/fxfa/parser/xfa_locale.h | |
parent | 1194561d5d83869edecf6a1f402122a59955f0b7 (diff) | |
download | pdfium-b4d1b576bccb5ca6cebe29288af014bd0f512af1.tar.xz |
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
Diffstat (limited to 'xfa/fxfa/parser/xfa_locale.h')
-rw-r--r-- | xfa/fxfa/parser/xfa_locale.h | 8 |
1 files changed, 5 insertions, 3 deletions
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 <memory> + #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<CXML_Element> 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<CXML_Element> 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_ |