[email protected] | f10de7ec | 2012-10-27 02:18:10 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 | // Use of this source code is governed by a BSD-style license that can be | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #include "net/quic/quic_clock.h" | ||||
6 | |||||
[email protected] | f002abb | 2013-06-28 02:30:21 | [diff] [blame] | 7 | #include "base/time/time.h" |
[email protected] | f10de7ec | 2012-10-27 02:18:10 | [diff] [blame] | 8 | |
9 | namespace net { | ||||
10 | |||||
11 | QuicClock::QuicClock() { | ||||
12 | } | ||||
13 | |||||
14 | QuicClock::~QuicClock() {} | ||||
15 | |||||
[email protected] | 9db44391 | 2013-02-25 05:27:03 | [diff] [blame] | 16 | QuicTime QuicClock::ApproximateNow() const { |
17 | // Chrome does not have a distinct notion of ApproximateNow(). | ||||
18 | return Now(); | ||||
19 | } | ||||
20 | |||||
[email protected] | 2a960e0 | 2012-11-11 14:48:10 | [diff] [blame] | 21 | QuicTime QuicClock::Now() const { |
22 | return QuicTime(base::TimeTicks::Now()); | ||||
[email protected] | f10de7ec | 2012-10-27 02:18:10 | [diff] [blame] | 23 | } |
24 | |||||
[email protected] | 2532de1 | 2013-05-09 12:29:33 | [diff] [blame] | 25 | QuicWallTime QuicClock::WallNow() const { |
[email protected] | 9d9ae55 | 2013-06-05 01:21:24 | [diff] [blame] | 26 | return QuicWallTime::FromUNIXSeconds(base::Time::Now().ToTimeT()); |
[email protected] | 5558281 | 2012-12-19 01:34:41 | [diff] [blame] | 27 | } |
28 | |||||
[email protected] | f10de7ec | 2012-10-27 02:18:10 | [diff] [blame] | 29 | } // namespace net |