diff options
author | Lei Zhang <thestig@chromium.org> | 2017-12-04 06:04:35 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-12-04 06:04:35 +0000 |
commit | 56b08b1f2bb8a4eb9330963bff3a626603499730 (patch) | |
tree | 406c3453ad65a08c56aa3c15b6f70d7b149b84a7 /xfa/fxfa/parser/cxfa_simple_parser.h | |
parent | b8d86800487df4021860f08407c323ed82243c79 (diff) | |
download | pdfium-56b08b1f2bb8a4eb9330963bff3a626603499730.tar.xz |
Make CXFA_SimpleParser members const or Unowned.
Fix ownership issues, and simplify CXFA_SimpleParser ctors.
Change-Id: Ie083080297c5c2586ae3e6a8355839fcb86ee9ea
Reviewed-on: https://pdfium-review.googlesource.com/20130
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_simple_parser.h')
-rw-r--r-- | xfa/fxfa/parser/cxfa_simple_parser.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/xfa/fxfa/parser/cxfa_simple_parser.h b/xfa/fxfa/parser/cxfa_simple_parser.h index 2ccb2c3b1a..52bb60fac5 100644 --- a/xfa/fxfa/parser/cxfa_simple_parser.h +++ b/xfa/fxfa/parser/cxfa_simple_parser.h @@ -22,7 +22,8 @@ class CFX_SeekableStreamProxy; class CXFA_SimpleParser { public: - CXFA_SimpleParser(CXFA_Document* pFactory, bool bDocumentParser); + CXFA_SimpleParser(); + explicit CXFA_SimpleParser(CXFA_Document* pFactory); ~CXFA_SimpleParser(); int32_t StartParse(const RetainPtr<IFX_SeekableStream>& pStream, @@ -34,6 +35,7 @@ class CXFA_SimpleParser { CFX_XMLDoc* GetXMLDoc() const; void CloseParser(); + // Called later for the ctor with no parameters. void SetFactory(CXFA_Document* pFactory); private: @@ -71,15 +73,16 @@ class CXFA_SimpleParser { CFX_XMLInstruction* pXMLInstruction, XFA_PacketType ePacketID); - CFX_XMLParser* m_pXMLParser; + UnownedPtr<CFX_XMLParser> m_pXMLParser; // Owned by |m_pXMLDoc| std::unique_ptr<CFX_XMLDoc> m_pXMLDoc; RetainPtr<CFX_SeekableStreamProxy> m_pStream; RetainPtr<IFX_SeekableStream> m_pFileRead; - CXFA_Document* m_pFactory; - CXFA_Node* m_pRootNode; - XFA_PacketType m_ePacketID; - bool m_bParseStarted; - bool m_bDocumentParser; + UnownedPtr<CXFA_Document> m_pFactory; + // TODO(dsinclair): Figure out who owns this. + CXFA_Node* m_pRootNode = nullptr; + XFA_PacketType m_ePacketID = XFA_PacketType::User; + bool m_bParseStarted = false; + const bool m_bDocumentParser; }; #endif // XFA_FXFA_PARSER_CXFA_SIMPLE_PARSER_H_ |