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

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

Issue 48803004: Have Document::nodeWillBeRemoved() take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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/Document.h ('k') | Source/core/dom/NodeIterator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 3f4d27cb88978ab503883ffa1b63583c1df3b03e..cd10bc5a08dccce4d4be6b6e382a7032ee75fdbd 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -3498,19 +3498,19 @@ void Document::nodeChildrenWillBeRemoved(ContainerNode* container)
HashSet<NodeIterator*>::const_iterator nodeIteratorsEnd = m_nodeIterators.end();
for (HashSet<NodeIterator*>::const_iterator it = m_nodeIterators.begin(); it != nodeIteratorsEnd; ++it) {
for (Node* n = container->firstChild(); n; n = n->nextSibling())
- (*it)->nodeWillBeRemoved(n);
+ (*it)->nodeWillBeRemoved(*n);
}
if (Frame* frame = this->frame()) {
for (Node* n = container->firstChild(); n; n = n->nextSibling()) {
- frame->eventHandler().nodeWillBeRemoved(n);
- frame->selection().nodeWillBeRemoved(n);
- frame->page()->dragCaretController().nodeWillBeRemoved(n);
+ frame->eventHandler().nodeWillBeRemoved(*n);
+ frame->selection().nodeWillBeRemoved(*n);
+ frame->page()->dragCaretController().nodeWillBeRemoved(*n);
}
}
}
-void Document::nodeWillBeRemoved(Node* n)
+void Document::nodeWillBeRemoved(Node& n)
{
HashSet<NodeIterator*>::const_iterator nodeIteratorsEnd = m_nodeIterators.end();
for (HashSet<NodeIterator*>::const_iterator it = m_nodeIterators.begin(); it != nodeIteratorsEnd; ++it)
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/NodeIterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698