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

Unified Diff: net/quic/quic_alarm.cc

Issue 476023002: Land Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0814_2
Patch Set: Created 6 years, 4 months 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
« no previous file with comments | « net/quic/quic_alarm.h ('k') | net/quic/quic_alarm_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()) {
+ Cancel();
+ return;
+ }
+ if (std::abs(deadline.Subtract(deadline_).ToMicroseconds()) <
+ granularity.ToMicroseconds()) {
+ return;
+ }
+ Cancel();
+ Set(deadline);
+}
+
bool QuicAlarm::IsSet() const {
return deadline_.IsInitialized();
}
« no previous file with comments | « net/quic/quic_alarm.h ('k') | net/quic/quic_alarm_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698