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

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

Issue 1858833003: Move isNavigationAllowed() check to main entry point for loads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reflow comment Created 4 years, 8 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 | « third_party/WebKit/Source/core/loader/FrameLoader.cpp ('k') | 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/NavigationScheduler.cpp
diff --git a/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp b/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp
index b33d21493967ed0059abfd29dba13408abff5137..06703f8453814e5de73f6003e4439f2273dec25d 100644
--- a/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp
+++ b/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp
@@ -278,6 +278,23 @@ bool NavigationScheduler::isNavigationScheduledWithin(double interval) const
return m_redirect && m_redirect->delay() <= interval;
}
+// TODO(dcheng): There are really two different load blocking concepts at work
+// here and they have been incorrectly tangled together.
+//
+// 1. NavigationDisablerForBeforeUnload is for blocking navigation scheduling
dcheng 2016/04/05 00:06:29 Avi, given this description, do you think it still
Avi (use Gerrit) 2016/04/05 01:36:33 I know about the dialog side of onbeforeunload, bu
dcheng 2016/04/05 04:47:22 While the beforeunload dialog is open, no script c
+// during a beforeunload event. Scheduled navigations during beforeunload
+// would make it possible to get trapped in an endless loop of beforeunload
+// dialogs.
+//
+// Checking Frame::isNavigationAllowed() doesn't make sense in this context:
+// NavigationScheduler is always cleared when a new load commits, so it's
+// impossible for a scheduled navigation to clobber a navigation that just
+// committed.
+//
+// 2. FrameNavigationDisabler / LocalFrame::isNavigationAllowed() are intended
+// to prevent Documents from being reattached during destruction, since it
+// can cause bugs with security origin confusion. This is primarily intended
+// to block /synchronous/ navigations during things lke Document::detach().
inline bool NavigationScheduler::shouldScheduleReload() const
{
return m_frame->page() && m_frame->isNavigationAllowed() && NavigationDisablerForBeforeUnload::isNavigationAllowed();
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameLoader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698