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 // Helper class to track the rate data can leave the buffer for pacing. | 5 // Helper class to track the rate data can leave the buffer for pacing. |
6 // A leaky bucket drains the data at a constant rate regardless of fullness of | 6 // A leaky bucket drains the data at a constant rate regardless of fullness of |
7 // the buffer. | 7 // the buffer. |
8 // See http://en.wikipedia.org/wiki/Leaky_bucket for more details. | 8 // See http://en.wikipedia.org/wiki/Leaky_bucket for more details. |
9 | 9 |
10 #ifndef NET_QUIC_CONGESTION_CONTROL_LEAKY_BUCKET_H_ | 10 #ifndef NET_QUIC_CONGESTION_CONTROL_LEAKY_BUCKET_H_ |
11 #define NET_QUIC_CONGESTION_CONTROL_LEAKY_BUCKET_H_ | 11 #define NET_QUIC_CONGESTION_CONTROL_LEAKY_BUCKET_H_ |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "net/base/net_export.h" | 14 #include "net/base/net_export.h" |
15 #include "net/quic/quic_bandwidth.h" | 15 #include "net/quic/quic_bandwidth.h" |
16 #include "net/quic/quic_clock.h" | |
17 #include "net/quic/quic_protocol.h" | 16 #include "net/quic/quic_protocol.h" |
18 #include "net/quic/quic_time.h" | 17 #include "net/quic/quic_time.h" |
19 | 18 |
20 namespace net { | 19 namespace net { |
21 | 20 |
22 class NET_EXPORT_PRIVATE LeakyBucket { | 21 class NET_EXPORT_PRIVATE LeakyBucket { |
23 public: | 22 public: |
24 explicit LeakyBucket(QuicBandwidth draining_rate); | 23 explicit LeakyBucket(QuicBandwidth draining_rate); |
25 | 24 |
26 // Set the rate at which the bytes leave the buffer. | 25 // Set the rate at which the bytes leave the buffer. |
(...skipping 14 matching lines...) Expand all Loading... |
41 QuicByteCount bytes_; | 40 QuicByteCount bytes_; |
42 QuicTime time_last_updated_; | 41 QuicTime time_last_updated_; |
43 QuicBandwidth draining_rate_; | 42 QuicBandwidth draining_rate_; |
44 | 43 |
45 DISALLOW_COPY_AND_ASSIGN(LeakyBucket); | 44 DISALLOW_COPY_AND_ASSIGN(LeakyBucket); |
46 }; | 45 }; |
47 | 46 |
48 } // namespace net | 47 } // namespace net |
49 | 48 |
50 #endif // NET_QUIC_CONGESTION_CONTROL_LEAKY_BUCKET_H_ | 49 #endif // NET_QUIC_CONGESTION_CONTROL_LEAKY_BUCKET_H_ |
OLD | NEW |