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