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 // 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 "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "net/quic/quic_time.h" | 11 #include "net/quic/quic_time.h" |
12 | 12 |
13 namespace net { | 13 namespace net { |
14 | 14 |
15 typedef uint64 QuicByteCount; | 15 typedef uint64 QuicByteCount; |
16 | 16 |
17 class NET_EXPORT_PRIVATE QuicBandwidth { | 17 class NET_EXPORT_PRIVATE QuicBandwidth { |
18 | |
19 public: | 18 public: |
20 // Creates a new QuicBandwidth with an internal value of 0. | 19 // Creates a new QuicBandwidth with an internal value of 0. |
21 static QuicBandwidth Zero(); | 20 static QuicBandwidth Zero(); |
22 | 21 |
23 // Create a new QuicBandwidth holding the bits per second. | 22 // Create a new QuicBandwidth holding the bits per second. |
24 static QuicBandwidth FromBitsPerSecond(int64 bits_per_second); | 23 static QuicBandwidth FromBitsPerSecond(int64 bits_per_second); |
25 | 24 |
26 // Create a new QuicBandwidth holding the kilo bits per second. | 25 // Create a new QuicBandwidth holding the kilo bits per second. |
27 static QuicBandwidth FromKBitsPerSecond(int64 k_bits_per_second); | 26 static QuicBandwidth FromKBitsPerSecond(int64 k_bits_per_second); |
28 | 27 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 } | 77 } |
79 inline bool operator<=(QuicBandwidth lhs, QuicBandwidth rhs) { | 78 inline bool operator<=(QuicBandwidth lhs, QuicBandwidth rhs) { |
80 return !(rhs < lhs); | 79 return !(rhs < lhs); |
81 } | 80 } |
82 inline bool operator>=(QuicBandwidth lhs, QuicBandwidth rhs) { | 81 inline bool operator>=(QuicBandwidth lhs, QuicBandwidth rhs) { |
83 return !(lhs < rhs); | 82 return !(lhs < rhs); |
84 } | 83 } |
85 | 84 |
86 } // namespace net | 85 } // namespace net |
87 #endif // NET_QUIC_QUIC_BANDWIDTH_H_ | 86 #endif // NET_QUIC_QUIC_BANDWIDTH_H_ |
OLD | NEW |