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

Side by Side Diff: net/quic/quic_time.cc

Issue 968233004: Land Recent QUIC Changes until 03/02/2015. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup
Patch Set: Created 5 years, 9 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/quic_stream_sequencer_test.cc ('k') | net/quic/quic_time_wait_list_manager.cc » ('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/quic_time.h" 5 #include "net/quic/quic_time.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace net { 9 namespace net {
10 10
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 } 166 }
167 167
168 QuicWallTime QuicWallTime::Add(QuicTime::Delta delta) const { 168 QuicWallTime QuicWallTime::Add(QuicTime::Delta delta) const {
169 uint64 seconds = seconds_ + delta.ToSeconds(); 169 uint64 seconds = seconds_ + delta.ToSeconds();
170 if (seconds < seconds_) { 170 if (seconds < seconds_) {
171 seconds = kuint64max; 171 seconds = kuint64max;
172 } 172 }
173 return QuicWallTime(seconds); 173 return QuicWallTime(seconds);
174 } 174 }
175 175
176 // TODO(ianswett) Test this.
176 QuicWallTime QuicWallTime::Subtract(QuicTime::Delta delta) const { 177 QuicWallTime QuicWallTime::Subtract(QuicTime::Delta delta) const {
177 uint64 seconds = seconds_ - delta.ToSeconds(); 178 uint64 seconds = seconds_ - delta.ToSeconds();
178 if (seconds > seconds_) { 179 if (seconds > seconds_) {
179 seconds = 0; 180 seconds = 0;
180 } 181 }
181 return QuicWallTime(seconds); 182 return QuicWallTime(seconds);
182 } 183 }
183 184
184 QuicWallTime::QuicWallTime(uint64 seconds) 185 QuicWallTime::QuicWallTime(uint64 seconds)
185 : seconds_(seconds) { 186 : seconds_(seconds) {
186 } 187 }
187 188
188 } // namespace net 189 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_stream_sequencer_test.cc ('k') | net/quic/quic_time_wait_list_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698