From 2c06db876d00780ec5816c05c9cd0a7574ee1e06 Mon Sep 17 00:00:00 2001 From: Olli Pettay Date: Fri, 26 May 2017 09:13:39 -0400 Subject: [PATCH] Bug 1311425, review comment fix to ensure low priority timers aren't taken into account when calling NS_GetTimerDeadlineHintOnCurrentThread, r=smaug --- xpcom/threads/TimerThread.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xpcom/threads/TimerThread.cpp b/xpcom/threads/TimerThread.cpp index 54524ee40bcf..dd72e12a24bf 100644 --- a/xpcom/threads/TimerThread.cpp +++ b/xpcom/threads/TimerThread.cpp @@ -608,15 +608,15 @@ TimerThread::FindNextFireTimeForCurrentThread(TimeStamp aDefault, uint32_t aSear break; } - // Track the currently highest timeout so that we can bail when we - // reach the bound or when we find a timer for the current thread. - timeStamp = timer->mTimeout; - // Don't yield to timers created with the *_LOW_PRIORITY type. if (timer->IsLowPriority()) { continue; } + // Track the currently highest timeout so that we can bail when we + // reach the bound or when we find a timer for the current thread. + timeStamp = timer->mTimeout; + bool isOnCurrentThread = false; nsresult rv = timer->mEventTarget->IsOnCurrentThread(&isOnCurrentThread); if (NS_WARN_IF(NS_FAILED(rv))) {