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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 274
275 void LocalFrame::detach(FrameDetachType type) 275 void LocalFrame::detach(FrameDetachType type)
276 { 276 {
277 PluginScriptForbiddenScope forbidPluginDestructorScripting; 277 PluginScriptForbiddenScope forbidPluginDestructorScripting;
278 // A lot of the following steps can result in the current frame being 278 // A lot of the following steps can result in the current frame being
279 // detached, so protect a reference to it. 279 // detached, so protect a reference to it.
280 RefPtrWillBeRawPtr<LocalFrame> protect(this); 280 RefPtrWillBeRawPtr<LocalFrame> protect(this);
281 m_loader.stopAllLoaders(); 281 m_loader.stopAllLoaders();
282 m_loader.dispatchUnloadEvent(); 282 m_loader.dispatchUnloadEvent();
283 detachChildren(); 283 detachChildren();
284
285 // All done if detaching the subframes brought about a detach of this frame also.
286 if (!client())
287 return;
288
284 // stopAllLoaders() needs to be called after detachChildren(), because detac hChildren() 289 // stopAllLoaders() needs to be called after detachChildren(), because detac hChildren()
285 // will trigger the unload event handlers of any child frames, and those eve nt 290 // will trigger the unload event handlers of any child frames, and those eve nt
286 // handlers might start a new subresource load in this frame. 291 // handlers might start a new subresource load in this frame.
287 m_loader.stopAllLoaders(); 292 m_loader.stopAllLoaders();
288 m_loader.detach(); 293 m_loader.detach();
289 document()->detach(); 294 document()->detach();
290 m_loader.clear(); 295 m_loader.clear();
291 if (!client()) 296 if (!client())
292 return; 297 return;
293 298
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 { 852 {
848 if (isLocalRoot()) 853 if (isLocalRoot())
849 m_instrumentingAgents = InstrumentingAgents::create(); 854 m_instrumentingAgents = InstrumentingAgents::create();
850 else 855 else
851 m_instrumentingAgents = localFrameRoot()->m_instrumentingAgents; 856 m_instrumentingAgents = localFrameRoot()->m_instrumentingAgents;
852 } 857 }
853 858
854 DEFINE_WEAK_IDENTIFIER_MAP(LocalFrame); 859 DEFINE_WEAK_IDENTIFIER_MAP(LocalFrame);
855 860
856 } // namespace blink 861 } // namespace blink
OLDNEW
« 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