diff options
author | dsinclair <dsinclair@chromium.org> | 2016-07-11 08:55:08 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-11 08:55:08 -0700 |
commit | bb95c50663a1ba3378c6b079dc21dc7deb8ea53a (patch) | |
tree | c604c09399411c2d002c789ff8073e11f210632f /xfa/fxfa/parser/cxfa_simple_parser.h | |
parent | 34f86b0c7816289d2a0b402d1909572f4e95613b (diff) | |
download | pdfium-bb95c50663a1ba3378c6b079dc21dc7deb8ea53a.tar.xz |
Cleanup ownership of parser members
Change m_pXMLDoc and m_pStream in CXFA_SimpleParser to be a unique_ptr. This
allows removing the CloseParser() call from CXFA_DocumentParser as the items
will get cleaned up automatically.
Review-Url: https://codereview.chromium.org/2131653002
Diffstat (limited to 'xfa/fxfa/parser/cxfa_simple_parser.h')
-rw-r--r-- | xfa/fxfa/parser/cxfa_simple_parser.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/xfa/fxfa/parser/cxfa_simple_parser.h b/xfa/fxfa/parser/cxfa_simple_parser.h index d49008da91..e8b39b09bc 100644 --- a/xfa/fxfa/parser/cxfa_simple_parser.h +++ b/xfa/fxfa/parser/cxfa_simple_parser.h @@ -7,6 +7,8 @@ #ifndef XFA_FXFA_PARSER_CXFA_SIMPLE_PARSER_H_ #define XFA_FXFA_PARSER_CXFA_SIMPLE_PARSER_H_ +#include <memory> + #include "xfa/fde/xml/fde_xml_imp.h" #include "xfa/fxfa/include/fxfa_basic.h" @@ -73,8 +75,8 @@ class CXFA_SimpleParser { void SetFactory(CXFA_Document* pFactory); CXFA_XMLParser* m_pXMLParser; - CFDE_XMLDoc* m_pXMLDoc; - IFX_Stream* m_pStream; + std::unique_ptr<CFDE_XMLDoc> m_pXMLDoc; + std::unique_ptr<IFX_Stream, ReleaseDeleter<IFX_Stream>> m_pStream; IFX_FileRead* m_pFileRead; CXFA_Document* m_pFactory; CXFA_Node* m_pRootNode; |