Bug 1190735 - Remove nsITimer.TYPE_REPEATING_PRECISE. r=froydnj.

This commit is contained in:
Nicholas Nethercote
2015-08-04 17:30:53 -07:00
parent 73a0c40ce7
commit ef84da2ece
5 changed files with 21 additions and 49 deletions

View File

@@ -291,12 +291,6 @@ nsTimerImpl::SetDelay(uint32_t aDelay)
return NS_ERROR_NOT_INITIALIZED;
}
// If we're already repeating precisely, update mTimeout now so that the
// new delay takes effect in the future.
if (!mTimeout.IsNull() && mType == TYPE_REPEATING_PRECISE) {
mTimeout = TimeStamp::Now();
}
SetDelayInternal(aDelay);
if (!mFiring && gThread) {
@@ -476,10 +470,9 @@ nsTimerImpl::Fire()
("[this=%p] Took %fms to fire timer callback\n",
this, (TimeStamp::Now() - now).ToMilliseconds()));
// Reschedule repeating timers, except REPEATING_PRECISE which already did
// that in PostTimerEvent, but make sure that we aren't armed already (which
// can happen if the callback reinitialized the timer).
if (IsRepeating() && mType != TYPE_REPEATING_PRECISE && !mArmed) {
// Reschedule repeating timers, but make sure that we aren't armed already
// (which can happen if the callback reinitialized the timer).
if (IsRepeating() && !mArmed) {
if (mType == TYPE_REPEATING_SLACK) {
SetDelayInternal(mDelay); // force mTimeout to be recomputed. For
}
@@ -499,9 +492,7 @@ nsTimerImpl::SetDelayInternal(uint32_t aDelay)
mDelay = aDelay;
TimeStamp now = TimeStamp::Now();
if (mTimeout.IsNull() || mType != TYPE_REPEATING_PRECISE) {
mTimeout = now;
}
mTimeout = now;
mTimeout += delayInterval;