OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/quic/test_tools/mock_clock.h" | 5 #include "net/quic/test_tools/mock_clock.h" |
6 | 6 |
7 namespace net { | 7 namespace net { |
8 | 8 |
9 MockClock::MockClock() : now_(QuicTime::Zero()) { | 9 MockClock::MockClock() : now_(QuicTime::Zero()) { |
10 } | 10 } |
(...skipping 14 matching lines...) Expand all Loading... |
25 } | 25 } |
26 | 26 |
27 QuicWallTime MockClock::WallNow() const { | 27 QuicWallTime MockClock::WallNow() const { |
28 return QuicWallTime::FromUNIXSeconds( | 28 return QuicWallTime::FromUNIXSeconds( |
29 now_.Subtract(QuicTime::Zero()).ToSeconds()); | 29 now_.Subtract(QuicTime::Zero()).ToSeconds()); |
30 } | 30 } |
31 | 31 |
32 base::TimeTicks MockClock::NowInTicks() const { | 32 base::TimeTicks MockClock::NowInTicks() const { |
33 base::TimeTicks ticks; | 33 base::TimeTicks ticks; |
34 return ticks + base::TimeDelta::FromMicroseconds( | 34 return ticks + base::TimeDelta::FromMicroseconds( |
35 now_.Subtract(QuicTime::Zero()).ToMicroseconds()); | 35 now_.Subtract(QuicTime::Zero()).ToMicroseconds()); |
36 } | 36 } |
37 | 37 |
38 } // namespace net | 38 } // namespace net |
OLD | NEW |