summaryrefslogtreecommitdiff
path: root/core/fxcrt/xml/cfx_xmldoc.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-04-12 13:15:59 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-12 13:15:59 +0000
commita995d6fd9b862dbd37aebb9c323766bb5d11d389 (patch)
treedb204479d0c854d1e30840794972d5115cbe80f4 /core/fxcrt/xml/cfx_xmldoc.cpp
parent332139df2c3c0826069fa61bcd436309fcdf5a6f (diff)
downloadpdfium-a995d6fd9b862dbd37aebb9c323766bb5d11d389.tar.xz
Allow retrieving the XML tree from the CFX_XMLDoc
This CL allows the CXFA_SimpleParser to retrieve the XML tree from the CFX_XMLDoc. This way, we don't have to keep the doc around and can store the pointer to the tree in the CXFA_SimpleParser. Change-Id: I5b478acbe61e6f1ca5fa04d03133a2b327a0cb1c Reviewed-on: https://pdfium-review.googlesource.com/30210 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt/xml/cfx_xmldoc.cpp')
-rw-r--r--core/fxcrt/xml/cfx_xmldoc.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/core/fxcrt/xml/cfx_xmldoc.cpp b/core/fxcrt/xml/cfx_xmldoc.cpp
index 57be180f9a..c14255d432 100644
--- a/core/fxcrt/xml/cfx_xmldoc.cpp
+++ b/core/fxcrt/xml/cfx_xmldoc.cpp
@@ -18,20 +18,14 @@
#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
-CFX_XMLDoc::CFX_XMLDoc(const RetainPtr<CFX_SeekableStreamProxy>& pStream)
- : m_pRoot(pdfium::MakeUnique<CFX_XMLNode>()),
- m_pXMLParser(pdfium::MakeUnique<CFX_XMLParser>(m_pRoot.get(), pStream)) {
- ASSERT(pStream);
-
+CFX_XMLDoc::CFX_XMLDoc() : m_pRoot(pdfium::MakeUnique<CFX_XMLNode>()) {
m_pRoot->AppendChild(new CFX_XMLInstruction(L"xml"));
}
CFX_XMLDoc::~CFX_XMLDoc() {}
-int32_t CFX_XMLDoc::Load() {
- return m_pXMLParser->Parse();
-}
-
-void CFX_XMLDoc::CloseXML() {
- m_pXMLParser.reset();
+bool CFX_XMLDoc::Load(const RetainPtr<CFX_SeekableStreamProxy>& pStream) {
+ ASSERT(pStream);
+ CFX_XMLParser parser(m_pRoot.get(), pStream);
+ return parser.Parse();
}