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

Unified Diff: net/quic/chromium/quic_clock_skew_detector.h

Issue 2487973003: GOAWAY open QUIC sessions if clock skew is detected (Closed)
Patch Set: format Created 4 years, 1 month 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: net/quic/chromium/quic_clock_skew_detector.h
diff --git a/net/quic/chromium/quic_clock_skew_detector.h b/net/quic/chromium/quic_clock_skew_detector.h
new file mode 100644
index 0000000000000000000000000000000000000000..1cc26f86622c9d0c48e8291b301115f418700fad
--- /dev/null
+++ b/net/quic/chromium/quic_clock_skew_detector.h
@@ -0,0 +1,30 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_QUIC_CHROMIUM_QUIC_CLOCK_SKEW_DETECTOR_H_
+#define NET_QUIC_CHROMIUM_QUIC_CLOCK_SKEW_DETECTOR_H_
+
+#include "base/time/time.h"
+#include "net/base/net_export.h"
+
+namespace net {
+
+class NET_EXPORT_PRIVATE QuicClockSkewDetector {
+ public:
+ QuicClockSkewDetector(base::TimeTicks ticks_time, base::Time wall_time);
+
+ // Returns true if the delta between |wall_now| and |last_wall_time_| is
+ // more than one second larger than the delta between |ticks_now| and
+ // |last_ticks_time_|. Updates |last_ticks_time_| and |last_wall_time_|.
+ bool ClockSkewDetected(base::TimeTicks ticks_now, base::Time wall_now);
+
+ private:
+ // Clock skew detection members
+ base::TimeTicks last_ticks_time_;
+ base::Time last_wall_time_;
+};
+
+} // namespace net
+
+#endif // NET_QUIC_CHROMIUM_QUIC_CLOCK_SKEW_DETECTOR_H_

Powered by Google App Engine
This is Rietveld 408576698