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

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

Issue 1303153008: Revert of Make NavigationScheduler post loading tasks instead of timers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 | « Source/core/loader/NavigationScheduler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/NavigationScheduler.cpp
diff --git a/Source/core/loader/NavigationScheduler.cpp b/Source/core/loader/NavigationScheduler.cpp
index fb383ba36357f39070c5ddb80384382b3addf2c4..2841a7980c71c1b8148245126de3899c5819f461 100644
--- a/Source/core/loader/NavigationScheduler.cpp
+++ b/Source/core/loader/NavigationScheduler.cpp
@@ -48,7 +48,6 @@
#include "core/page/Page.h"
#include "platform/SharedBuffer.h"
#include "platform/UserGestureIndicator.h"
-#include "public/platform/Platform.h"
#include "wtf/CurrentTime.h"
namespace blink {
@@ -267,7 +266,7 @@
NavigationScheduler::NavigationScheduler(LocalFrame* frame)
: m_frame(frame)
- , m_navigateTaskFactory(WTF::bind(&NavigationScheduler::navigateTask, this))
+ , m_timer(this, &NavigationScheduler::timerFired)
, m_navigationDisableCount(0)
{
}
@@ -372,7 +371,7 @@
schedule(ScheduledReload::create());
}
-void NavigationScheduler::navigateTask()
+void NavigationScheduler::timerFired(Timer<NavigationScheduler>*)
{
if (!m_frame->page())
return;
@@ -414,22 +413,20 @@
return;
ASSERT(m_frame->page());
- if (m_navigateTaskFactory.isPending())
+ if (m_timer.isActive())
return;
if (!m_redirect->shouldStartTimer(m_frame))
return;
- Platform::current()->currentThread()->scheduler()->loadingTaskRunner()->postDelayedTask(
- FROM_HERE, m_navigateTaskFactory.cancelAndCreate(), m_redirect->delay());
-
+ m_timer.startOneShot(m_redirect->delay(), FROM_HERE);
InspectorInstrumentation::frameScheduledNavigation(m_frame, m_redirect->delay());
}
void NavigationScheduler::cancel()
{
- if (m_navigateTaskFactory.isPending())
+ if (m_timer.isActive())
InspectorInstrumentation::frameClearedScheduledNavigation(m_frame);
- m_navigateTaskFactory.cancel();
+ m_timer.stop();
m_redirect.clear();
}
« no previous file with comments | « Source/core/loader/NavigationScheduler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698