Chromium Code Reviews| 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; |
| } |