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

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

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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.cc ('k') | net/quic/quic_unacked_packet_map.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/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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 QuicTime::Delta QuicTime::Delta::Subtract(const Delta& delta) const { 60 QuicTime::Delta QuicTime::Delta::Subtract(const Delta& delta) const {
61 return QuicTime::Delta::FromMicroseconds(ToMicroseconds() - 61 return QuicTime::Delta::FromMicroseconds(ToMicroseconds() -
62 delta.ToMicroseconds()); 62 delta.ToMicroseconds());
63 } 63 }
64 64
65 QuicTime::Delta QuicTime::Delta::Multiply(int i) const { 65 QuicTime::Delta QuicTime::Delta::Multiply(int i) const {
66 return QuicTime::Delta::FromMicroseconds(ToMicroseconds() * i); 66 return QuicTime::Delta::FromMicroseconds(ToMicroseconds() * i);
67 } 67 }
68 68
69 QuicTime::Delta QuicTime::Delta::Multiply(double d) const { 69 QuicTime::Delta QuicTime::Delta::Multiply(double d) const {
70 return QuicTime::Delta::FromMicroseconds(ToMicroseconds() * d); 70 return QuicTime::Delta::FromMicroseconds(
71 static_cast<int64>(ToMicroseconds() * d));
71 } 72 }
72 73
73 // static 74 // static
74 QuicTime::Delta QuicTime::Delta::Max(QuicTime::Delta delta1, 75 QuicTime::Delta QuicTime::Delta::Max(QuicTime::Delta delta1,
75 QuicTime::Delta delta2) { 76 QuicTime::Delta delta2) {
76 return delta1 < delta2 ? delta2 : delta1; 77 return delta1 < delta2 ? delta2 : delta1;
77 } 78 }
78 79
79 bool QuicTime::Delta::IsZero() const { 80 bool QuicTime::Delta::IsZero() const {
80 return delta_.InMicroseconds() == 0; 81 return delta_.InMicroseconds() == 0;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 seconds = 0; 179 seconds = 0;
179 } 180 }
180 return QuicWallTime(seconds); 181 return QuicWallTime(seconds);
181 } 182 }
182 183
183 QuicWallTime::QuicWallTime(uint64 seconds) 184 QuicWallTime::QuicWallTime(uint64 seconds)
184 : seconds_(seconds) { 185 : seconds_(seconds) {
185 } 186 }
186 187
187 } // namespace net 188 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_stream_sequencer.cc ('k') | net/quic/quic_unacked_packet_map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698