From 70180648ffd01dd3716871758411d2031aaaebbe Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 2 May 2018 16:02:03 +0000 Subject: 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 Commit-Queue: dsinclair --- xfa/fxfa/parser/cxfa_nodeowner.cpp | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'xfa/fxfa/parser/cxfa_nodeowner.cpp') diff --git a/xfa/fxfa/parser/cxfa_nodeowner.cpp b/xfa/fxfa/parser/cxfa_nodeowner.cpp index dba32dc889..ae6f589616 100644 --- a/xfa/fxfa/parser/cxfa_nodeowner.cpp +++ b/xfa/fxfa/parser/cxfa_nodeowner.cpp @@ -15,19 +15,6 @@ CXFA_NodeOwner::CXFA_NodeOwner() = default; CXFA_NodeOwner::~CXFA_NodeOwner() = default; -void CXFA_NodeOwner::ReleaseXMLNodesIfNeeded() { - // Because we don't know what order we'll free the nodes we may end up - // destroying the XML tree before nodes have been cleaned up that point into - // it. This will cause the ProbeForLowSeverityLifetimeIssue to fire. - // - // This doesn't happen in the destructor because of the ownership semantics - // between the CXFA_Document and CXFA_DocumentParser. It has to happen before - // the simple parser is destroyed, but the document has to live longer then - // the simple parser. - for (auto& it : nodes_) - it->ReleaseXMLNodeIfUnowned(); -} - CXFA_Node* CXFA_NodeOwner::AddOwnedNode(std::unique_ptr node) { if (!node) return nullptr; -- cgit v1.2.3