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

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: Rename for Sami 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
« no previous file with comments | « content/test/fake_renderer_scheduler.cc ('k') | third_party/WebKit/public/platform/WebScheduler.h » ('j') | 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 440e46d4a0cc6ddb51934009f6eb554f1f7b6d1e..ac4236b1b8dba7d04a46556437879b382c49189c 100644
--- a/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp
+++ b/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp
@@ -275,6 +275,10 @@ NavigationScheduler::NavigationScheduler(LocalFrame* frame)
NavigationScheduler::~NavigationScheduler()
{
+ // TODO(alexclarke): Can remove this if oilpan is on since any pending task should
+ // keep the NavigationScheduler alive.
+ if (m_navigateTaskFactory->isPending())
+ Platform::current()->currentThread()->scheduler()->removePendingNavigation();
}
bool NavigationScheduler::locationChangePending()
@@ -375,6 +379,8 @@ void NavigationScheduler::scheduleReload()
void NavigationScheduler::navigateTask()
{
+ Platform::current()->currentThread()->scheduler()->removePendingNavigation();
+
if (!m_frame->page())
return;
if (m_frame->page()->defersLoading()) {
@@ -420,7 +426,9 @@ void NavigationScheduler::startTimer()
if (!m_redirect->shouldStartTimer(m_frame))
return;
- Platform::current()->currentThread()->scheduler()->loadingTaskRunner()->postDelayedTask(
+ WebScheduler* scheduler = Platform::current()->currentThread()->scheduler();
+ scheduler->addPendingNavigation();
+ scheduler->loadingTaskRunner()->postDelayedTask(
FROM_HERE, m_navigateTaskFactory->cancelAndCreate(), m_redirect->delay() * 1000.0);
InspectorInstrumentation::frameScheduledNavigation(m_frame, m_redirect->delay());
@@ -428,8 +436,10 @@ void NavigationScheduler::startTimer()
void NavigationScheduler::cancel()
{
- if (m_navigateTaskFactory->isPending())
+ if (m_navigateTaskFactory->isPending()) {
+ Platform::current()->currentThread()->scheduler()->removePendingNavigation();
InspectorInstrumentation::frameClearedScheduledNavigation(m_frame);
+ }
m_navigateTaskFactory->cancel();
m_redirect.clear();
}
« no previous file with comments | « content/test/fake_renderer_scheduler.cc ('k') | third_party/WebKit/public/platform/WebScheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698