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

Unified Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 2393133005: Call LocalDOMWindow::clearDocument when a frame gets detached
Patch Set: temp Created 4 years 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/frame/LocalDOMWindow.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/frame/LocalFrame.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
index 2c1032aecb501ccaef1f27cde55e16e3374f9b11..25f6339b811b44038a1aff4516419c6fb60506d7 100644
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -398,6 +398,8 @@ void LocalFrame::detach(FrameDetachType type) {
// frame on a detached DOM tree, which is bad.
SubframeLoadingDisabler disabler(*document());
m_loader.dispatchUnloadEvent();
+ if (!client())
+ return;
detachChildren();
// All done if detaching the subframes brought about a detach of this frame
@@ -485,7 +487,7 @@ bool LocalFrame::shouldClose() {
}
void LocalFrame::detachChildren() {
- DCHECK(m_loader.stateMachine()->creatingInitialEmptyDocument() || document());
+ CHECK(m_loader.stateMachine()->creatingInitialEmptyDocument() || document());
if (Document* document = this->document())
ChildFrameDisconnector(*document).disconnect();
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698