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

Unified Diff: Source/core/dom/TreeWalker.cpp

Issue 285213003: Oilpan: move Node traversal objects to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Drop nullptr type conversions 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/dom/TreeWalker.h ('k') | Source/core/dom/TreeWalker.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/TreeWalker.cpp
diff --git a/Source/core/dom/TreeWalker.cpp b/Source/core/dom/TreeWalker.cpp
index 5b53ffdc664768ff70f33be25d8fe616961f0fbf..dfa29d55e4db80e1ec05f9fcadd9bfe39acff549 100644
--- a/Source/core/dom/TreeWalker.cpp
+++ b/Source/core/dom/TreeWalker.cpp
@@ -33,14 +33,14 @@
namespace WebCore {
-TreeWalker::TreeWalker(PassRefPtr<Node> rootNode, unsigned whatToShow, PassRefPtr<NodeFilter> filter)
+TreeWalker::TreeWalker(PassRefPtrWillBeRawPtr<Node> rootNode, unsigned whatToShow, PassRefPtrWillBeRawPtr<NodeFilter> filter)
: NodeIteratorBase(rootNode, whatToShow, filter)
, m_current(root())
{
ScriptWrappable::init(this);
}
-void TreeWalker::setCurrentNode(PassRefPtr<Node> node, ExceptionState& exceptionState)
+void TreeWalker::setCurrentNode(PassRefPtrWillBeRawPtr<Node> node, ExceptionState& exceptionState)
{
if (!node) {
exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::argumentNullOrIncorrectType(1, "Node"));
@@ -49,7 +49,7 @@ void TreeWalker::setCurrentNode(PassRefPtr<Node> node, ExceptionState& exception
m_current = node;
}
-inline Node* TreeWalker::setCurrent(PassRefPtr<Node> node)
+inline Node* TreeWalker::setCurrent(PassRefPtrWillBeRawPtr<Node> node)
{
m_current = node;
return m_current.get();
@@ -57,7 +57,7 @@ inline Node* TreeWalker::setCurrent(PassRefPtr<Node> node)
Node* TreeWalker::parentNode(ExceptionState& exceptionState)
{
- RefPtr<Node> node = m_current;
+ RefPtrWillBeRawPtr<Node> node = m_current;
while (node != root()) {
node = node->parentNode();
if (!node)
@@ -73,7 +73,7 @@ Node* TreeWalker::parentNode(ExceptionState& exceptionState)
Node* TreeWalker::firstChild(ExceptionState& exceptionState)
{
- for (RefPtr<Node> node = m_current->firstChild(); node; ) {
+ for (RefPtrWillBeRawPtr<Node> node = m_current->firstChild(); node; ) {
short acceptNodeResult = acceptNode(node.get(), exceptionState);
if (exceptionState.hadException())
return 0;
@@ -106,7 +106,7 @@ Node* TreeWalker::firstChild(ExceptionState& exceptionState)
Node* TreeWalker::lastChild(ExceptionState& exceptionState)
{
- for (RefPtr<Node> node = m_current->lastChild(); node; ) {
+ for (RefPtrWillBeRawPtr<Node> node = m_current->lastChild(); node; ) {
short acceptNodeResult = acceptNode(node.get(), exceptionState);
if (exceptionState.hadException())
return 0;
@@ -139,11 +139,11 @@ Node* TreeWalker::lastChild(ExceptionState& exceptionState)
Node* TreeWalker::previousSibling(ExceptionState& exceptionState)
{
- RefPtr<Node> node = m_current;
+ RefPtrWillBeRawPtr<Node> node = m_current;
if (node == root())
return 0;
while (1) {
- for (RefPtr<Node> sibling = node->previousSibling(); sibling; ) {
+ for (RefPtrWillBeRawPtr<Node> sibling = node->previousSibling(); sibling; ) {
short acceptNodeResult = acceptNode(sibling.get(), exceptionState);
if (exceptionState.hadException())
return 0;
@@ -176,11 +176,11 @@ Node* TreeWalker::previousSibling(ExceptionState& exceptionState)
Node* TreeWalker::nextSibling(ExceptionState& exceptionState)
{
- RefPtr<Node> node = m_current;
+ RefPtrWillBeRawPtr<Node> node = m_current;
if (node == root())
return 0;
while (1) {
- for (RefPtr<Node> sibling = node->nextSibling(); sibling; ) {
+ for (RefPtrWillBeRawPtr<Node> sibling = node->nextSibling(); sibling; ) {
short acceptNodeResult = acceptNode(sibling.get(), exceptionState);
if (exceptionState.hadException())
return 0;
@@ -213,7 +213,7 @@ Node* TreeWalker::nextSibling(ExceptionState& exceptionState)
Node* TreeWalker::previousNode(ExceptionState& exceptionState)
{
- RefPtr<Node> node = m_current;
+ RefPtrWillBeRawPtr<Node> node = m_current;
while (node != root()) {
while (Node* previousSibling = node->previousSibling()) {
node = previousSibling;
@@ -252,7 +252,7 @@ Node* TreeWalker::previousNode(ExceptionState& exceptionState)
Node* TreeWalker::nextNode(ExceptionState& exceptionState)
{
- RefPtr<Node> node = m_current;
+ RefPtrWillBeRawPtr<Node> node = m_current;
Children:
while (Node* firstChild = node->firstChild()) {
node = firstChild;
@@ -277,4 +277,10 @@ Children:
return 0;
}
+void TreeWalker::trace(Visitor* visitor)
+{
+ visitor->trace(m_current);
+ NodeIteratorBase::trace(visitor);
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/dom/TreeWalker.h ('k') | Source/core/dom/TreeWalker.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698