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

Side by Side Diff: net/quic/test_tools/mock_clock.cc

Issue 2132623002: Landing Recent QUIC changes until 2016-07-02 02:45 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing comment about RPCs Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « net/quic/reliable_quic_stream.cc ('k') | net/quic/test_tools/quic_session_peer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 MockClock::~MockClock() {} 11 MockClock::~MockClock() {}
12 12
13 void MockClock::AdvanceTime(QuicTime::Delta delta) { 13 void MockClock::AdvanceTime(QuicTime::Delta delta) {
14 now_ = now_.Add(delta); 14 now_ = now_ + delta;
15 } 15 }
16 16
17 QuicTime MockClock::Now() const { 17 QuicTime MockClock::Now() const {
18 return now_; 18 return now_;
19 } 19 }
20 20
21 QuicTime MockClock::ApproximateNow() const { 21 QuicTime MockClock::ApproximateNow() const {
22 return now_; 22 return now_;
23 } 23 }
24 24
25 QuicWallTime MockClock::WallNow() const { 25 QuicWallTime MockClock::WallNow() const {
26 return QuicWallTime::FromUNIXSeconds( 26 return QuicWallTime::FromUNIXSeconds((now_ - QuicTime::Zero()).ToSeconds());
27 now_.Subtract(QuicTime::Zero()).ToSeconds());
28 } 27 }
29 28
30 base::TimeTicks MockClock::NowInTicks() const { 29 base::TimeTicks MockClock::NowInTicks() const {
31 base::TimeTicks ticks; 30 base::TimeTicks ticks;
32 return ticks + base::TimeDelta::FromMicroseconds( 31 return ticks + base::TimeDelta::FromMicroseconds(
33 now_.Subtract(QuicTime::Zero()).ToMicroseconds()); 32 (now_ - QuicTime::Zero()).ToMicroseconds());
34 } 33 }
35 34
36 } // namespace net 35 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/reliable_quic_stream.cc ('k') | net/quic/test_tools/quic_session_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698