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

Unified Diff: Source/core/html/parser/HTMLElementStack.cpp

Issue 298043008: [Oilpan]: Move HTMLStackItem and friends to the oilpan heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix windows build Created 6 years, 7 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 | « Source/core/html/parser/HTMLElementStack.h ('k') | Source/core/html/parser/HTMLFormattingElementList.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/HTMLElementStack.cpp
diff --git a/Source/core/html/parser/HTMLElementStack.cpp b/Source/core/html/parser/HTMLElementStack.cpp
index ccbbdd87ace9cab855ba06270409954e9d0d9d5d..92db841a363ee9007e3c4522b940fba0bc87df20 100644
--- a/Source/core/html/parser/HTMLElementStack.cpp
+++ b/Source/core/html/parser/HTMLElementStack.cpp
@@ -119,18 +119,20 @@ inline bool isSelectScopeMarker(HTMLStackItem* item)
}
-HTMLElementStack::ElementRecord::ElementRecord(PassRefPtr<HTMLStackItem> item, PassOwnPtr<ElementRecord> next)
+HTMLElementStack::ElementRecord::ElementRecord(PassRefPtrWillBeRawPtr<HTMLStackItem> item, PassOwnPtrWillBeRawPtr<ElementRecord> next)
: m_item(item)
, m_next(next)
{
ASSERT(m_item);
}
+#if !ENABLE(OILPAN)
HTMLElementStack::ElementRecord::~ElementRecord()
{
}
+#endif
-void HTMLElementStack::ElementRecord::replaceElement(PassRefPtr<HTMLStackItem> item)
+void HTMLElementStack::ElementRecord::replaceElement(PassRefPtrWillBeRawPtr<HTMLStackItem> item)
{
ASSERT(item);
ASSERT(!m_item || m_item->isElementNode());
@@ -147,10 +149,18 @@ bool HTMLElementStack::ElementRecord::isAbove(ElementRecord* other) const
return false;
}
+void HTMLElementStack::ElementRecord::trace(Visitor* visitor)
+{
+#if ENABLE(OILPAN)
+ visitor->trace(m_item);
+ visitor->trace(m_next);
+#endif
+}
+
HTMLElementStack::HTMLElementStack()
- : m_rootNode(0)
- , m_headElement(0)
- , m_bodyElement(0)
+ : m_rootNode(nullptr)
+ , m_headElement(nullptr)
+ , m_bodyElement(nullptr)
, m_stackDepth(0)
{
}
@@ -179,22 +189,22 @@ bool HTMLElementStack::secondElementIsHTMLBodyElement() const
void HTMLElementStack::popHTMLHeadElement()
{
ASSERT(top() == m_headElement);
- m_headElement = 0;
+ m_headElement = nullptr;
popCommon();
}
void HTMLElementStack::popHTMLBodyElement()
{
ASSERT(top() == m_bodyElement);
- m_bodyElement = 0;
+ m_bodyElement = nullptr;
popCommon();
}
void HTMLElementStack::popAll()
{
- m_rootNode = 0;
- m_headElement = 0;
- m_bodyElement = 0;
+ m_rootNode = nullptr;
+ m_headElement = nullptr;
+ m_bodyElement = nullptr;
m_stackDepth = 0;
while (m_top) {
Node& node = *topNode();
@@ -301,19 +311,19 @@ void HTMLElementStack::popUntilForeignContentScopeMarker()
pop();
}
-void HTMLElementStack::pushRootNode(PassRefPtr<HTMLStackItem> rootItem)
+void HTMLElementStack::pushRootNode(PassRefPtrWillBeRawPtr<HTMLStackItem> rootItem)
{
ASSERT(rootItem->isDocumentFragmentNode());
pushRootNodeCommon(rootItem);
}
-void HTMLElementStack::pushHTMLHtmlElement(PassRefPtr<HTMLStackItem> item)
+void HTMLElementStack::pushHTMLHtmlElement(PassRefPtrWillBeRawPtr<HTMLStackItem> item)
{
ASSERT(item->hasTagName(htmlTag));
pushRootNodeCommon(item);
}
-void HTMLElementStack::pushRootNodeCommon(PassRefPtr<HTMLStackItem> rootItem)
+void HTMLElementStack::pushRootNodeCommon(PassRefPtrWillBeRawPtr<HTMLStackItem> rootItem)
{
ASSERT(!m_top);
ASSERT(!m_rootNode);
@@ -321,7 +331,7 @@ void HTMLElementStack::pushRootNodeCommon(PassRefPtr<HTMLStackItem> rootItem)
pushCommon(rootItem);
}
-void HTMLElementStack::pushHTMLHeadElement(PassRefPtr<HTMLStackItem> item)
+void HTMLElementStack::pushHTMLHeadElement(PassRefPtrWillBeRawPtr<HTMLStackItem> item)
{
ASSERT(item->hasTagName(HTMLNames::headTag));
ASSERT(!m_headElement);
@@ -329,7 +339,7 @@ void HTMLElementStack::pushHTMLHeadElement(PassRefPtr<HTMLStackItem> item)
pushCommon(item);
}
-void HTMLElementStack::pushHTMLBodyElement(PassRefPtr<HTMLStackItem> item)
+void HTMLElementStack::pushHTMLBodyElement(PassRefPtrWillBeRawPtr<HTMLStackItem> item)
{
ASSERT(item->hasTagName(HTMLNames::bodyTag));
ASSERT(!m_bodyElement);
@@ -337,7 +347,7 @@ void HTMLElementStack::pushHTMLBodyElement(PassRefPtr<HTMLStackItem> item)
pushCommon(item);
}
-void HTMLElementStack::push(PassRefPtr<HTMLStackItem> item)
+void HTMLElementStack::push(PassRefPtrWillBeRawPtr<HTMLStackItem> item)
{
ASSERT(!item->hasTagName(htmlTag));
ASSERT(!item->hasTagName(headTag));
@@ -346,7 +356,7 @@ void HTMLElementStack::push(PassRefPtr<HTMLStackItem> item)
pushCommon(item);
}
-void HTMLElementStack::insertAbove(PassRefPtr<HTMLStackItem> item, ElementRecord* recordBelow)
+void HTMLElementStack::insertAbove(PassRefPtrWillBeRawPtr<HTMLStackItem> item, ElementRecord* recordBelow)
{
ASSERT(item);
ASSERT(recordBelow);
@@ -365,7 +375,7 @@ void HTMLElementStack::insertAbove(PassRefPtr<HTMLStackItem> item, ElementRecord
continue;
m_stackDepth++;
- recordAbove->setNext(adoptPtr(new ElementRecord(item, recordAbove->releaseNext())));
+ recordAbove->setNext(adoptPtrWillBeNoop(new ElementRecord(item, recordAbove->releaseNext())));
recordAbove->next()->element()->beginParsingChildren();
return;
}
@@ -395,7 +405,7 @@ void HTMLElementStack::removeHTMLHeadElement(Element* element)
popHTMLHeadElement();
return;
}
- m_headElement = 0;
+ m_headElement = nullptr;
removeNonTopCommon(element);
}
@@ -556,12 +566,12 @@ ContainerNode* HTMLElementStack::rootNode() const
return m_rootNode;
}
-void HTMLElementStack::pushCommon(PassRefPtr<HTMLStackItem> item)
+void HTMLElementStack::pushCommon(PassRefPtrWillBeRawPtr<HTMLStackItem> item)
{
ASSERT(m_rootNode);
m_stackDepth++;
- m_top = adoptPtr(new ElementRecord(item, m_top.release()));
+ m_top = adoptPtrWillBeNoop(new ElementRecord(item, m_top.release()));
}
void HTMLElementStack::popCommon()
@@ -606,6 +616,14 @@ HTMLElementStack::ElementRecord* HTMLElementStack::furthestBlockForFormattingEle
return 0;
}
+void HTMLElementStack::trace(Visitor* visitor)
+{
+ visitor->trace(m_top);
+ visitor->trace(m_rootNode);
+ visitor->trace(m_headElement);
+ visitor->trace(m_bodyElement);
+}
+
#ifndef NDEBUG
void HTMLElementStack::show()
« no previous file with comments | « Source/core/html/parser/HTMLElementStack.h ('k') | Source/core/html/parser/HTMLFormattingElementList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698