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

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

Issue 1290053003: Handle LocalFrame being nestedly detached by subframe. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 5 years, 4 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 | « LayoutTests/fast/frames/detach-frame-from-child-detach-no-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/LocalFrame.cpp
diff --git a/Source/core/frame/LocalFrame.cpp b/Source/core/frame/LocalFrame.cpp
index 837b38ac87116e94034b5d2e352d1f74c51ad0f4..35975f313b488a5891afda26cba9c194895d7d12 100644
--- a/Source/core/frame/LocalFrame.cpp
+++ b/Source/core/frame/LocalFrame.cpp
@@ -281,6 +281,11 @@ void LocalFrame::detach(FrameDetachType type)
m_loader.stopAllLoaders();
m_loader.dispatchUnloadEvent();
detachChildren();
+
+ // All done if detaching the subframes brought about a detach of this frame also.
+ if (!client())
+ return;
+
// stopAllLoaders() needs to be called after detachChildren(), because detachChildren()
// will trigger the unload event handlers of any child frames, and those event
// handlers might start a new subresource load in this frame.
« no previous file with comments | « LayoutTests/fast/frames/detach-frame-from-child-detach-no-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698