Skip return value check for stopped repeating tasks.

If the repeated task stopped itself, the return value does not matter,
therefore we don't have to check it.

Bug: webrtc:10365
Change-Id: I4a2c7a40a287dd0a8099628e228e9c319409576b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127545
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27121}
This commit is contained in:
Sebastian Jansson
2019-03-13 16:35:59 +01:00
committed by Commit Bot
parent 5d7e43936e
commit d841ea6b58

View File

@ -30,13 +30,13 @@ bool RepeatingTaskBase::Run() {
return true;
TimeDelta delay = RunClosure();
RTC_DCHECK(delay.IsFinite());
// The closure might have stopped this task, in which case we return true to
// destruct this object.
if (next_run_time_.IsPlusInfinity())
return true;
RTC_DCHECK(delay.IsFinite());
TimeDelta lost_time = Timestamp::us(rtc::TimeMicros()) - next_run_time_;
next_run_time_ += delay;
delay -= lost_time;