| Index: Source/platform/ThreadTimers.cpp
|
| diff --git a/Source/platform/ThreadTimers.cpp b/Source/platform/ThreadTimers.cpp
|
| index 0cc2ac15b644033a6f2d56c7ae000c1778b37fa6..25d14afa5c896245ddacd0ffb9b293c1d935bb3e 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()))
|
| break;
|
| }
|
|
|
|
|