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

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: Better fix 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 // TODO(dcheng): Strictly speaking, this only needs to be scoped immediately
327 // before detachChildren(). However, this was previously scoped to the
328 // unload event as well. Investigate if it's possible to move it after
329 // dispatchUnloadEvent(), and if it makes sense to do that.
330 SubframeLoadingDisabler disabler(*document());
323 m_loader.dispatchUnloadEvent(); 331 m_loader.dispatchUnloadEvent();
324 detachChildren(); 332 detachChildren();
325 m_frameScheduler.clear(); 333 m_frameScheduler.clear();
326 334
327 // All done if detaching the subframes brought about a detach of this frame also. 335 // All done if detaching the subframes brought about a detach of this frame also.
328 if (!client()) 336 if (!client())
329 return; 337 return;
330 338
331 // stopAllLoaders() needs to be called after detachChildren(), because detac hChildren() 339 // 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 340 // 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 { 914 {
907 m_frame->disableNavigation(); 915 m_frame->disableNavigation();
908 } 916 }
909 917
910 FrameNavigationDisabler::~FrameNavigationDisabler() 918 FrameNavigationDisabler::~FrameNavigationDisabler()
911 { 919 {
912 m_frame->enableNavigation(); 920 m_frame->enableNavigation();
913 } 921 }
914 922
915 } // namespace blink 923 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698