зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1787974 - Fixed small logic change in FindNextFireTimeForCurrentThread(). r=smaug
I also took a stab at documenting the behavior since I found it a bit difficult to follow. Differential Revision: https://phabricator.services.mozilla.com/D165120
This commit is contained in:
Родитель
9ca4dc4b49
Коммит
e2a49f1133
|
@ -779,12 +779,12 @@ TimeStamp TimerThread::FindNextFireTimeForCurrentThread(TimeStamp aDefault,
|
||||||
AUTO_TIMERS_STATS(TimerThread_FindNextFireTimeForCurrentThread);
|
AUTO_TIMERS_STATS(TimerThread_FindNextFireTimeForCurrentThread);
|
||||||
|
|
||||||
for (const Entry& entry : mTimers) {
|
for (const Entry& entry : mTimers) {
|
||||||
if (entry.Timeout() >= aDefault) {
|
|
||||||
return aDefault;
|
|
||||||
}
|
|
||||||
|
|
||||||
const nsTimerImpl* timer = entry.Value();
|
const nsTimerImpl* timer = entry.Value();
|
||||||
if (timer) {
|
if (timer) {
|
||||||
|
if (entry.Timeout() > aDefault) {
|
||||||
|
return aDefault;
|
||||||
|
}
|
||||||
|
|
||||||
// Don't yield to timers created with the *_LOW_PRIORITY type.
|
// Don't yield to timers created with the *_LOW_PRIORITY type.
|
||||||
if (!timer->IsLowPriority()) {
|
if (!timer->IsLowPriority()) {
|
||||||
bool isOnCurrentThread = false;
|
bool isOnCurrentThread = false;
|
||||||
|
|
|
@ -47,6 +47,10 @@ class TimerThread final : public mozilla::Runnable, public nsIObserver {
|
||||||
MOZ_REQUIRES(aTimer->mMutex);
|
MOZ_REQUIRES(aTimer->mMutex);
|
||||||
nsresult RemoveTimer(nsTimerImpl* aTimer, const MutexAutoLock& aProofOfLock)
|
nsresult RemoveTimer(nsTimerImpl* aTimer, const MutexAutoLock& aProofOfLock)
|
||||||
MOZ_REQUIRES(aTimer->mMutex);
|
MOZ_REQUIRES(aTimer->mMutex);
|
||||||
|
// Considering only the first 'aSearchBound' timers (in firing order), returns
|
||||||
|
// the timeout of the first non-low-priority timer, on the current thread,
|
||||||
|
// that will fire before 'aDefault'. If no such timer exists, 'aDefault' is
|
||||||
|
// returned.
|
||||||
TimeStamp FindNextFireTimeForCurrentThread(TimeStamp aDefault,
|
TimeStamp FindNextFireTimeForCurrentThread(TimeStamp aDefault,
|
||||||
uint32_t aSearchBound);
|
uint32_t aSearchBound);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче