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

Side by Side Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 1659013003: Don't reset LoadEventProgress if frame unload has already started. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit test and adjust comments. 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 unified diff | Download patch
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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 } 313 }
314 } 314 }
315 315
316 void LocalFrame::detach(FrameDetachType type) 316 void LocalFrame::detach(FrameDetachType type)
317 { 317 {
318 PluginScriptForbiddenScope forbidPluginDestructorScripting; 318 PluginScriptForbiddenScope forbidPluginDestructorScripting;
319 // A lot of the following steps can result in the current frame being 319 // A lot of the following steps can result in the current frame being
320 // detached, so protect a reference to it. 320 // detached, so protect a reference to it.
321 RefPtrWillBeRawPtr<LocalFrame> protect(this); 321 RefPtrWillBeRawPtr<LocalFrame> protect(this);
322 m_loader.stopAllLoaders(); 322 m_loader.stopAllLoaders();
323 // Don't allow any new child frames to load in this frame: attaching a new
324 // child frame during or after detaching children results in an attached
325 // frame on a detached DOM tree, which is bad.
326 SubframeLoadingDisabler disabler(*document());
323 m_loader.dispatchUnloadEvent(); 327 m_loader.dispatchUnloadEvent();
324 detachChildren(); 328 detachChildren();
325 m_frameScheduler.clear(); 329 m_frameScheduler.clear();
326 330
327 // All done if detaching the subframes brought about a detach of this frame also. 331 // All done if detaching the subframes brought about a detach of this frame also.
328 if (!client()) 332 if (!client())
329 return; 333 return;
330 334
331 // stopAllLoaders() needs to be called after detachChildren(), because detac hChildren() 335 // stopAllLoaders() needs to be called after detachChildren(), because detac hChildren()
332 // will trigger the unload event handlers of any child frames, and those eve nt 336 // will trigger the unload event handlers of any child frames, and those eve nt
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 { 910 {
907 m_frame->disableNavigation(); 911 m_frame->disableNavigation();
908 } 912 }
909 913
910 FrameNavigationDisabler::~FrameNavigationDisabler() 914 FrameNavigationDisabler::~FrameNavigationDisabler()
911 { 915 {
912 m_frame->enableNavigation(); 916 m_frame->enableNavigation();
913 } 917 }
914 918
915 } // namespace blink 919 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698