forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquic_clock_skew_detector.h
30 lines (22 loc) · 955 Bytes
/
quic_clock_skew_detector.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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_QUIC_CLOCK_SKEW_DETECTOR_H_
#define NET_QUIC_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_QUIC_CLOCK_SKEW_DETECTOR_H_