Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Unified Diff: components/timers/rtc_alarm.cc

Issue 745123002: Link GCM heartbeat with wake on wifi preference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make GCM wake from suspend aware Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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),

Powered by Google App Engine
This is Rietveld 408576698