Index: net/quic/quic_alarm.cc |
diff --git a/net/quic/quic_alarm.cc b/net/quic/quic_alarm.cc |
index e1d4a16ae9c1d2a99dc929bac84884777a767a85..b5aca8caa175aae288f0d6f7c23f39b61bfed29a 100644 |
--- a/net/quic/quic_alarm.cc |
+++ b/net/quic/quic_alarm.cc |
@@ -27,6 +27,19 @@ void QuicAlarm::Cancel() { |
CancelImpl(); |
} |
+void QuicAlarm::Update(QuicTime deadline, QuicTime::Delta granularity) { |
+ if (!deadline.IsInitialized()) { |
wtc
2014/08/15 19:03:54
Just curious: why do we need this behavior when we
ramant (doing other things)
2014/08/15 19:18:33
Ian: would appreciate your reasoning (is it a conv
Ian Swett
2014/08/15 20:11:54
It is convenient, and semantically more accurate,
|
+ Cancel(); |
+ return; |
+ } |
+ if (std::abs(deadline.Subtract(deadline_).ToMicroseconds()) < |
+ granularity.ToMicroseconds()) { |
+ return; |
+ } |
+ Cancel(); |
+ Set(deadline); |
+} |
+ |
bool QuicAlarm::IsSet() const { |
return deadline_.IsInitialized(); |
} |