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

Unified Diff: Source/platform/ThreadTimers.cpp

Issue 656463004: Use the scheduling mechanism provided by the platform (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed header path. Created 6 years, 2 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: Source/platform/ThreadTimers.cpp
diff --git a/Source/platform/ThreadTimers.cpp b/Source/platform/ThreadTimers.cpp
index 0cc2ac15b644033a6f2d56c7ae000c1778b37fa6..692978b1a7ddb074483b633a7becebbcb74e09e8 100644
--- a/Source/platform/ThreadTimers.cpp
+++ b/Source/platform/ThreadTimers.cpp
@@ -31,7 +31,8 @@
#include "platform/SharedTimer.h"
#include "platform/Timer.h"
#include "platform/TraceEvent.h"
-#include "platform/scheduler/Scheduler.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebScheduler.h"
#include "wtf/CurrentTime.h"
#include "wtf/MainThread.h"
@@ -137,7 +138,11 @@ void ThreadTimers::sharedTimerFiredInternal()
timer.fired();
// Catch the case where the timer asked timers to fire in a nested event loop, or we are over time limit.
- if (!m_firingTimers || timeToQuit < monotonicallyIncreasingTime() || (isMainThread() && Scheduler::shared()->shouldYieldForHighPriorityWork()))
+ if (!m_firingTimers || timeToQuit < monotonicallyIncreasingTime())
+ break;
+
+ // Yield if there is more critical work pending on the main thread.
+ if (isMainThread() && Platform::current()->scheduler() && Platform::current()->scheduler()->shouldYieldForHighPriorityWork())
eseidel 2014/10/21 16:11:02 When does this ever fire not on the main thread?
Sami 2014/10/21 18:49:34 Web workers can have timers too.
break;
}

Powered by Google App Engine
This is Rietveld 408576698