Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Unified Diff: Source/core/xml/parser/XMLDocumentParser.cpp

Issue 320773002: Oilpan: Remove manual ref/deref of Nodes. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xml/parser/XMLDocumentParser.cpp
diff --git a/Source/core/xml/parser/XMLDocumentParser.cpp b/Source/core/xml/parser/XMLDocumentParser.cpp
index ae1e842653f51c0db4abb49515660fa3971bb791..879afb0c5ce2761565c0e42e4b1f5393c00f1802 100644
--- a/Source/core/xml/parser/XMLDocumentParser.cpp
+++ b/Source/core/xml/parser/XMLDocumentParser.cpp
@@ -299,8 +299,10 @@ void XMLDocumentParser::pushCurrentNode(ContainerNode* n)
{
ASSERT(n);
ASSERT(m_currentNode);
+#if !ENABLE(OILPAN)
if (n != document())
n->ref();
+#endif
m_currentNodeStack.append(m_currentNode);
m_currentNode = n;
if (m_currentNodeStack.size() > maxXMLTreeDepth)
@@ -312,26 +314,30 @@ void XMLDocumentParser::popCurrentNode()
if (!m_currentNode)
return;
ASSERT(m_currentNodeStack.size());
-
+#if !ENABLE(OILPAN)
if (m_currentNode != document())
m_currentNode->deref();
-
+#endif
m_currentNode = m_currentNodeStack.last();
m_currentNodeStack.removeLast();
}
void XMLDocumentParser::clearCurrentNodeStack()
{
+#if !ENABLE(OILPAN)
if (m_currentNode && m_currentNode != document())
m_currentNode->deref();
+#endif
m_currentNode = nullptr;
m_leafTextNode = nullptr;
if (m_currentNodeStack.size()) { // Aborted parsing.
+#if !ENABLE(OILPAN)
for (size_t i = m_currentNodeStack.size() - 1; i != 0; --i)
m_currentNodeStack[i]->deref();
if (m_currentNodeStack[0] && m_currentNodeStack[0] != document())
m_currentNodeStack[0]->deref();
+#endif
m_currentNodeStack.clear();
}
}
@@ -782,10 +788,12 @@ XMLDocumentParser::XMLDocumentParser(DocumentFragment* fragment, Element* parent
, m_scriptStartPosition(TextPosition::belowRangePosition())
, m_parsingFragment(true)
{
+#if !ENABLE(OILPAN)
fragment->ref();
+#endif
// Add namespaces based on the parent node
- Vector<Element*> elemStack;
+ WillBeHeapVector<RawPtrWillBeMember<Element> > elemStack;
while (parentElement) {
elemStack.append(parentElement);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698