diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-05-02 16:02:03 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-02 16:02:03 +0000 |
commit | 70180648ffd01dd3716871758411d2031aaaebbe (patch) | |
tree | 6cc1d7aa3df8c3e343a1ef6f7e032bae8499f6db /xfa/fxfa/parser/cxfa_document_parser.h | |
parent | 8ab2b2b2869f769dc169b4a96bb67ec596d5278b (diff) | |
download | pdfium-70180648ffd01dd3716871758411d2031aaaebbe.tar.xz |
Add a CFX_XMLDocument class.
This CL adds a CFX_XMLDocument to act as the XML node container. All
nodes are now owned by the document and the document is returned by the
CFX_XMLParser.
Classes which parse XML files now store the document instead of the root
node.
BUG: chromium:835636
Change-Id: I1e07d6115cf14714911d6fd4c3fa920c94fd5faf
Reviewed-on: https://pdfium-review.googlesource.com/31313
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_document_parser.h')
-rw-r--r-- | xfa/fxfa/parser/cxfa_document_parser.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xfa/fxfa/parser/cxfa_document_parser.h b/xfa/fxfa/parser/cxfa_document_parser.h index d76d5953ac..04ed5abb15 100644 --- a/xfa/fxfa/parser/cxfa_document_parser.h +++ b/xfa/fxfa/parser/cxfa_document_parser.h @@ -10,12 +10,12 @@ #include <memory> #include <utility> +#include "core/fxcrt/xml/cfx_xmldocument.h" #include "core/fxcrt/xml/cfx_xmlnode.h" #include "xfa/fxfa/fxfa_basic.h" class CXFA_Document; class CXFA_Node; -class CFX_XMLDoc; class CFX_XMLInstruction; class IFX_SeekableStream; @@ -30,11 +30,11 @@ class CXFA_DocumentParser { CFX_XMLNode* ParseXMLData(const ByteString& wsXML); void ConstructXFANode(CXFA_Node* pXFANode, CFX_XMLNode* pXMLNode); - std::unique_ptr<CFX_XMLNode> GetXMLRoot() { return std::move(m_pNodeTree); } + std::unique_ptr<CFX_XMLDocument> GetXMLDoc() { return std::move(xml_doc_); } CXFA_Node* GetRootNode() const; private: - std::unique_ptr<CFX_XMLNode> LoadXML( + std::unique_ptr<CFX_XMLDocument> LoadXML( const RetainPtr<IFX_SeekableStream>& pStream); CXFA_Node* ParseAsXDPPacket(CFX_XMLNode* pXMLDocumentNode, @@ -72,7 +72,7 @@ class CXFA_DocumentParser { XFA_PacketType ePacketID); UnownedPtr<CXFA_Document> m_pFactory; - std::unique_ptr<CFX_XMLNode> m_pNodeTree; + std::unique_ptr<CFX_XMLDocument> xml_doc_; // TODO(dsinclair): Figure out who owns this. CXFA_Node* m_pRootNode = nullptr; }; |