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

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameLoader.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) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
8 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 int nodeCount = static_cast<int>(totalNodeCount); 1035 int nodeCount = static_cast<int>(totalNodeCount);
1036 for (Document* document : Document::liveDocumentSet()) { 1036 for (Document* document : Document::liveDocumentSet()) {
1037 if (document != m_frame->document()) 1037 if (document != m_frame->document())
1038 nodeCount -= document->nodeCount(); 1038 nodeCount -= document->nodeCount();
1039 } 1039 }
1040 ASSERT(nodeCount >= 0); 1040 ASSERT(nodeCount >= 0);
1041 float ratio = static_cast<float>(nodeCount) / totalNodeCount; 1041 float ratio = static_cast<float>(nodeCount) / totalNodeCount;
1042 ThreadState::current()->schedulePageNavigationGCIfNeeded(ratio); 1042 ThreadState::current()->schedulePageNavigationGCIfNeeded(ratio);
1043 } 1043 }
1044 1044
1045 // Don't allow any new child frames to load in this frame: attaching a new
1046 // child frame during or after detaching children results in an attached
1047 // frame on a detached DOM tree, which is bad.
1048 SubframeLoadingDisabler disabler(m_frame->document());
1045 if (m_documentLoader) { 1049 if (m_documentLoader) {
1046 client()->dispatchWillClose(); 1050 client()->dispatchWillClose();
1047 dispatchUnloadEvent(); 1051 dispatchUnloadEvent();
1048 } 1052 }
1049 m_frame->detachChildren(); 1053 m_frame->detachChildren();
1050 // The previous calls to dispatchUnloadEvent() and detachChildren() can 1054 // The previous calls to dispatchUnloadEvent() and detachChildren() can
1051 // execute arbitrary script via things like unload events. If the executed 1055 // execute arbitrary script via things like unload events. If the executed
1052 // script intiates a new load or causes the current frame to be detached, 1056 // script intiates a new load or causes the current frame to be detached,
1053 // we need to abandon the current load. 1057 // we need to abandon the current load.
1054 if (pdl != m_provisionalDocumentLoader) 1058 if (pdl != m_provisionalDocumentLoader)
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
1550 // FIXME: We need a way to propagate insecure requests policy flags to 1554 // FIXME: We need a way to propagate insecure requests policy flags to
1551 // out-of-process frames. For now, we'll always use default behavior. 1555 // out-of-process frames. For now, we'll always use default behavior.
1552 if (!parentFrame->isLocalFrame()) 1556 if (!parentFrame->isLocalFrame())
1553 return nullptr; 1557 return nullptr;
1554 1558
1555 ASSERT(toLocalFrame(parentFrame)->document()); 1559 ASSERT(toLocalFrame(parentFrame)->document());
1556 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ; 1560 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ;
1557 } 1561 }
1558 1562
1559 } // namespace blink 1563 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698