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

Unified Diff: third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp

Issue 1770523002: Track connected subframes per-Document instead of per-Node. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix various crashes but still doesn't refcount tracked nodes (and needs to) Created 4 years, 10 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 | « third_party/WebKit/Source/core/dom/SubframeTracker.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
index 45cf6917e7ef553671e5368311fd6165371e64b3..9cba72e0fc09f9e30bc56ef05e29d760eebf8cd8 100644
--- a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
@@ -153,11 +153,10 @@ void HTMLFrameOwnerElement::setContentFrame(Frame& frame)
// Make sure we will not end up with two frames referencing the same owner element.
ASSERT(!m_contentFrame || m_contentFrame->owner() != this);
// Disconnected frames should not be allowed to load.
- ASSERT(inDocument());
- m_contentFrame = &frame;
+ ASSERT(inActiveDocument());
- for (ContainerNode* node = this; node; node = node->parentOrShadowHostNode())
- node->incrementConnectedSubframeCount();
+ m_contentFrame = &frame;
+ document().subframeTracker().connectSubframe(*this);
}
void HTMLFrameOwnerElement::clearContentFrame()
@@ -165,10 +164,10 @@ void HTMLFrameOwnerElement::clearContentFrame()
if (!m_contentFrame)
return;
+ // If there's a connected content frame, the parent frame must be active.
+ ASSERT(inActiveDocument());
m_contentFrame = nullptr;
-
- for (ContainerNode* node = this; node; node = node->parentOrShadowHostNode())
- node->decrementConnectedSubframeCount();
+ document().subframeTracker().disconnectSubframe(*this);
}
void HTMLFrameOwnerElement::disconnectContentFrame()
« no previous file with comments | « third_party/WebKit/Source/core/dom/SubframeTracker.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698