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

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

Issue 51273002: Have ChildFrameDisconnector / ChildListMutationScope deal with references (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/ContainerNodeAlgorithms.h ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ContainerNodeAlgorithms.cpp
diff --git a/Source/core/dom/ContainerNodeAlgorithms.cpp b/Source/core/dom/ContainerNodeAlgorithms.cpp
index afcb4ca9aa9b0f41505411d3c9fb20d0d2487b57..1caa683b9dc544297b145f3fee405d44716ff4e8 100644
--- a/Source/core/dom/ContainerNodeAlgorithms.cpp
+++ b/Source/core/dom/ContainerNodeAlgorithms.cpp
@@ -119,38 +119,38 @@ void ChildNodeRemovalNotifier::notifyDescendantRemovedFromTree(ContainerNode& no
}
}
-void ChildFrameDisconnector::collectFrameOwners(ElementShadow* shadow)
+void ChildFrameDisconnector::collectFrameOwners(ElementShadow& shadow)
{
- for (ShadowRoot* root = shadow->youngestShadowRoot(); root; root = root->olderShadowRoot())
- collectFrameOwners(root);
+ for (ShadowRoot* root = shadow.youngestShadowRoot(); root; root = root->olderShadowRoot())
+ collectFrameOwners(*root);
}
#ifndef NDEBUG
-unsigned assertConnectedSubrameCountIsConsistent(Node* node)
+unsigned assertConnectedSubrameCountIsConsistent(Node& node)
{
unsigned count = 0;
- if (node->isElementNode()) {
- if (node->isFrameOwnerElement() && toHTMLFrameOwnerElement(node)->contentFrame())
+ if (node.isElementNode()) {
+ if (node.isFrameOwnerElement() && toHTMLFrameOwnerElement(node).contentFrame())
count++;
- if (ElementShadow* shadow = toElement(node)->shadow()) {
+ if (ElementShadow* shadow = toElement(node).shadow()) {
for (ShadowRoot* root = shadow->youngestShadowRoot(); root; root = root->olderShadowRoot())
- count += assertConnectedSubrameCountIsConsistent(root);
+ count += assertConnectedSubrameCountIsConsistent(*root);
}
}
- for (Node* child = node->firstChild(); child; child = child->nextSibling())
- count += assertConnectedSubrameCountIsConsistent(child);
+ for (Node* child = node.firstChild(); child; child = child->nextSibling())
+ count += assertConnectedSubrameCountIsConsistent(*child);
// If we undercount there's possibly a security bug since we'd leave frames
// in subtrees outside the document.
- ASSERT(node->connectedSubframeCount() >= count);
+ ASSERT(node.connectedSubframeCount() >= count);
// If we overcount it's safe, but not optimal because it means we'll traverse
// through the document in ChildFrameDisconnector looking for frames that have
// already been disconnected.
- ASSERT(node->connectedSubframeCount() == count);
+ ASSERT(node.connectedSubframeCount() == count);
return count;
}
« no previous file with comments | « Source/core/dom/ContainerNodeAlgorithms.h ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698