Chromium Code Reviews| Index: components/timers/rtc_alarm.cc |
| diff --git a/components/timers/rtc_alarm.cc b/components/timers/rtc_alarm.cc |
| index 9f2750ebfe77a4d8586c0d6807e001de5e14b751..0c3dfdf352456b35394ca5b3107723cb3562efb5 100644 |
| --- a/components/timers/rtc_alarm.cc |
| +++ b/components/timers/rtc_alarm.cc |
| @@ -88,7 +88,11 @@ void RtcAlarm::Reset(base::TimeDelta delay) { |
| // differently. We queue the task here but we still go ahead and call |
| // timerfd_settime with the zero delay anyway to cancel any previous delay |
| // that might have been programmed. |
| - if (delay == base::TimeDelta()) { |
| + if (delay <= base::TimeDelta::FromMicroseconds(0)) { |
|
Daniel Erat
2014/12/04 23:23:16
any reason you can't use the shorter base::TimeDel
Chirantan Ekbote
2014/12/04 23:31:40
I did it mainly to make it painfully explicit and
|
| + // The timerfd_settime documentation is vague on what happens when it is |
| + // passed a negative delay. We can sidestep the issue by ensuring that the |
| + // delay is 0. |
| + delay = base::TimeDelta::FromMicroseconds(0); |
| origin_message_loop_->PostTask(FROM_HERE, |
| base::Bind(&RtcAlarm::OnTimerFired, |
| scoped_refptr<RtcAlarm>(this), |