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

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

Issue 1368643002: Add a signal to the scheduler that a navigation is expected (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Requested changes Created 5 years, 3 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
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 440e46d4a0cc6ddb51934009f6eb554f1f7b6d1e..4c2a61a75ea9e694b25d1b79548a5f582f414f6b 100644
--- a/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp
+++ b/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp
@@ -420,7 +420,9 @@ void NavigationScheduler::startTimer()
if (!m_redirect->shouldStartTimer(m_frame))
return;
- Platform::current()->currentThread()->scheduler()->loadingTaskRunner()->postDelayedTask(
+ WebScheduler* scheduler = Platform::current()->currentThread()->scheduler();
+ scheduler->onNavigationExpected();
+ scheduler->loadingTaskRunner()->postDelayedTask(
FROM_HERE, m_navigateTaskFactory->cancelAndCreate(), m_redirect->delay() * 1000.0);
InspectorInstrumentation::frameScheduledNavigation(m_frame, m_redirect->delay());
@@ -428,8 +430,10 @@ void NavigationScheduler::startTimer()
void NavigationScheduler::cancel()
{
- if (m_navigateTaskFactory->isPending())
+ if (m_navigateTaskFactory->isPending()) {
+ Platform::current()->currentThread()->scheduler()->onNavigationCanceled();
InspectorInstrumentation::frameClearedScheduledNavigation(m_frame);
+ }
m_navigateTaskFactory->cancel();
m_redirect.clear();
}

Powered by Google App Engine
This is Rietveld 408576698