OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef NET_QUIC_QUIC_SUSTAINED_BANDWIDTH_RECORDER_H_ | 5 #ifndef NET_QUIC_QUIC_SUSTAINED_BANDWIDTH_RECORDER_H_ |
6 #define NET_QUIC_QUIC_SUSTAINED_BANDWIDTH_RECORDER_H_ | 6 #define NET_QUIC_QUIC_SUSTAINED_BANDWIDTH_RECORDER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "net/base/net_export.h" | |
13 #include "net/quic/core/quic_bandwidth.h" | 12 #include "net/quic/core/quic_bandwidth.h" |
14 #include "net/quic/core/quic_time.h" | 13 #include "net/quic/core/quic_time.h" |
| 14 #include "net/quic/platform/api/quic_export.h" |
15 | 15 |
16 namespace net { | 16 namespace net { |
17 | 17 |
18 namespace test { | 18 namespace test { |
19 class QuicSustainedBandwidthRecorderPeer; | 19 class QuicSustainedBandwidthRecorderPeer; |
20 } // namespace test | 20 } // namespace test |
21 | 21 |
22 // This class keeps track of a sustained bandwidth estimate to ultimately send | 22 // This class keeps track of a sustained bandwidth estimate to ultimately send |
23 // to the client in a server config update message. A sustained bandwidth | 23 // to the client in a server config update message. A sustained bandwidth |
24 // estimate is only marked as valid if the QuicSustainedBandwidthRecorder has | 24 // estimate is only marked as valid if the QuicSustainedBandwidthRecorder has |
25 // been given uninterrupted reliable estimates over a certain period of time. | 25 // been given uninterrupted reliable estimates over a certain period of time. |
26 class NET_EXPORT_PRIVATE QuicSustainedBandwidthRecorder { | 26 class QUIC_EXPORT_PRIVATE QuicSustainedBandwidthRecorder { |
27 public: | 27 public: |
28 QuicSustainedBandwidthRecorder(); | 28 QuicSustainedBandwidthRecorder(); |
29 | 29 |
30 // As long as |in_recovery| is consistently false, multiple calls to this | 30 // As long as |in_recovery| is consistently false, multiple calls to this |
31 // method over a 3 * srtt period results in storage of a valid sustained | 31 // method over a 3 * srtt period results in storage of a valid sustained |
32 // bandwidth estimate. | 32 // bandwidth estimate. |
33 // |time_now| is used as a max bandwidth timestamp if needed. | 33 // |time_now| is used as a max bandwidth timestamp if needed. |
34 void RecordEstimate(bool in_recovery, | 34 void RecordEstimate(bool in_recovery, |
35 bool in_slow_start, | 35 bool in_slow_start, |
36 QuicBandwidth bandwidth, | 36 QuicBandwidth bandwidth, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 // Timestamp marking the beginning of the latest recording period. | 86 // Timestamp marking the beginning of the latest recording period. |
87 QuicTime start_time_; | 87 QuicTime start_time_; |
88 | 88 |
89 DISALLOW_COPY_AND_ASSIGN(QuicSustainedBandwidthRecorder); | 89 DISALLOW_COPY_AND_ASSIGN(QuicSustainedBandwidthRecorder); |
90 }; | 90 }; |
91 | 91 |
92 } // namespace net | 92 } // namespace net |
93 | 93 |
94 #endif // NET_QUIC_QUIC_SUSTAINED_BANDWIDTH_RECORDER_H_ | 94 #endif // NET_QUIC_QUIC_SUSTAINED_BANDWIDTH_RECORDER_H_ |
OLD | NEW |