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

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

Issue 419863004: Refactor frame detach to work for both local and remote frames. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix comment typo Created 6 years, 5 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/frame/LocalFrame.h ('k') | Source/core/frame/RemoteFrame.h » ('j') | 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 5ce5985dbbd35b192bdbe042de241d0e3f6ceeba..ae844e11359deedc39f8bfe3a00817c09b56c502 100644
--- a/Source/core/frame/LocalFrame.cpp
+++ b/Source/core/frame/LocalFrame.cpp
@@ -124,6 +124,21 @@ LocalFrame::~LocalFrame()
(*it)->frameDestroyed();
}
+void LocalFrame::detach()
+{
+ // A lot of the following steps can result in the current frame being
+ // detached, so protect a reference to it.
+ RefPtr<LocalFrame> protect(this);
+ m_loader.stopAllLoaders();
+ m_loader.closeURL();
+ detachChildren();
+ // 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.
+ m_loader.stopAllLoaders();
+ m_loader.detachFromParent();
+}
+
bool LocalFrame::inScope(TreeScope* scope) const
{
ASSERT(scope);
« no previous file with comments | « Source/core/frame/LocalFrame.h ('k') | Source/core/frame/RemoteFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698