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

Unified Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 2103703004: Always use FrameNavigationDisabler during DocumentLoader detach. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/loader/FrameLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
index 440f0a8f70bf33bfead5ab871e8c979e8386c600..a55f4d0157fcfccb37b42772c2211d76570f1b68 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -724,6 +724,7 @@ void FrameLoader::detachDocumentLoader(Member<DocumentLoader>& loader)
if (!loader)
return;
+ FrameNavigationDisabler navigationDisabler(*m_frame);
loader->detachFromFrame();
loader = nullptr;
}
@@ -1108,7 +1109,6 @@ bool FrameLoader::prepareForCommit()
// At this point, the provisional document loader should not detach, because
// then the FrameLoader would not have any attached DocumentLoaders.
if (m_documentLoader) {
- FrameNavigationDisabler navigationDisabler(*m_frame);
TemporaryChange<bool> inDetachDocumentLoader(m_protectProvisionalLoader, true);
detachDocumentLoader(m_documentLoader);
}
@@ -1419,10 +1419,7 @@ void FrameLoader::startLoad(FrameLoadRequest& frameLoadRequest, FrameLoadType ty
return;
m_frame->document()->cancelParsing();
- if (m_provisionalDocumentLoader) {
- FrameNavigationDisabler navigationDisabler(*m_frame);
- detachDocumentLoader(m_provisionalDocumentLoader);
- }
+ detachDocumentLoader(m_provisionalDocumentLoader);
// beforeunload fired above, and detaching a DocumentLoader can fire
// events, which can detach this frame.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698