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

Side by Side Diff: net/quic/core/quic_bandwidth.h

Issue 2322233004: Landing Recent QUIC changes until Sun Sep 4 03:41:00 (Closed)
Patch Set: Remove simulation files from the build. Created 4 years, 3 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/core/crypto/crypto_server_test.cc ('k') | net/quic/core/quic_client_promised_info.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 // QuicBandwidth represents a bandwidth, stored in bits per second resolution. 5 // QuicBandwidth represents a bandwidth, stored in bits per second resolution.
6 6
7 #ifndef NET_QUIC_QUIC_BANDWIDTH_H_ 7 #ifndef NET_QUIC_QUIC_BANDWIDTH_H_
8 #define NET_QUIC_QUIC_BANDWIDTH_H_ 8 #define NET_QUIC_QUIC_BANDWIDTH_H_
9 9
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 inline QuicBandwidth operator-(QuicBandwidth lhs, QuicBandwidth rhs) { 98 inline QuicBandwidth operator-(QuicBandwidth lhs, QuicBandwidth rhs) {
99 return QuicBandwidth(lhs.bits_per_second_ - rhs.bits_per_second_); 99 return QuicBandwidth(lhs.bits_per_second_ - rhs.bits_per_second_);
100 } 100 }
101 inline QuicBandwidth operator*(QuicBandwidth lhs, float rhs) { 101 inline QuicBandwidth operator*(QuicBandwidth lhs, float rhs) {
102 return QuicBandwidth( 102 return QuicBandwidth(
103 static_cast<int64_t>(std::llround(lhs.bits_per_second_ * rhs))); 103 static_cast<int64_t>(std::llround(lhs.bits_per_second_ * rhs)));
104 } 104 }
105 inline QuicBandwidth operator*(float lhs, QuicBandwidth rhs) { 105 inline QuicBandwidth operator*(float lhs, QuicBandwidth rhs) {
106 return rhs * lhs; 106 return rhs * lhs;
107 } 107 }
108 inline QuicByteCount operator*(QuicBandwidth lhs, QuicTime::Delta rhs) {
109 return lhs.ToBytesPerPeriod(rhs);
110 }
111 inline QuicByteCount operator*(QuicTime::Delta lhs, QuicBandwidth rhs) {
112 return rhs * lhs;
113 }
108 114
109 // Override stream output operator for gtest. 115 // Override stream output operator for gtest.
110 inline std::ostream& operator<<(std::ostream& output, 116 inline std::ostream& operator<<(std::ostream& output,
111 const QuicBandwidth bandwidth) { 117 const QuicBandwidth bandwidth) {
112 output << bandwidth.ToDebugValue(); 118 output << bandwidth.ToDebugValue();
113 return output; 119 return output;
114 } 120 }
115 121
116 } // namespace net 122 } // namespace net
117 #endif // NET_QUIC_QUIC_BANDWIDTH_H_ 123 #endif // NET_QUIC_QUIC_BANDWIDTH_H_
OLDNEW
« no previous file with comments | « net/quic/core/crypto/crypto_server_test.cc ('k') | net/quic/core/quic_client_promised_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698