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

Unified Diff: Source/platform/ThreadTimers.cpp

Issue 364873002: Introduce a basic Blink Scheduler (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Cleaned up includes + build fix. Created 6 years, 5 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 fe7b273aedecd92b209ab2550235d9b5699d4fbf..3e62a0858631ec2af5ae3bcf6c5b7b729b1e91e4 100644
--- a/Source/platform/ThreadTimers.cpp
+++ b/Source/platform/ThreadTimers.cpp
@@ -27,10 +27,11 @@
#include "config.h"
#include "platform/ThreadTimers.h"
-#include "platform/SharedTimer.h"
#include "platform/PlatformThreadData.h"
+#include "platform/SharedTimer.h"
#include "platform/Timer.h"
#include "platform/TraceEvent.h"
+#include "platform/scheduler/Scheduler.h"
#include "wtf/CurrentTime.h"
#include "wtf/MainThread.h"
@@ -138,7 +139,7 @@ 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())
+ if (!m_firingTimers || timeToQuit < monotonicallyIncreasingTime() || (isMainThread() && Scheduler::shared()->shouldYieldForHighPriorityWork()))
break;
}

Powered by Google App Engine
This is Rietveld 408576698