| 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> |
| 9 |
| 8 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/macros.h" |
| 9 #include "net/quic/quic_bandwidth.h" | 12 #include "net/quic/quic_bandwidth.h" |
| 10 #include "net/quic/quic_time.h" | 13 #include "net/quic/quic_time.h" |
| 11 | 14 |
| 12 namespace net { | 15 namespace net { |
| 13 | 16 |
| 14 namespace test { | 17 namespace test { |
| 15 class QuicSustainedBandwidthRecorderPeer; | 18 class QuicSustainedBandwidthRecorderPeer; |
| 16 } // namespace test | 19 } // namespace test |
| 17 | 20 |
| 18 // This class keeps track of a sustained bandwidth estimate to ultimately send | 21 // This class keeps track of a sustained bandwidth estimate to ultimately send |
| (...skipping 20 matching lines...) Expand all Loading... |
| 39 QuicBandwidth BandwidthEstimate() const { | 42 QuicBandwidth BandwidthEstimate() const { |
| 40 DCHECK(has_estimate_); | 43 DCHECK(has_estimate_); |
| 41 return bandwidth_estimate_; | 44 return bandwidth_estimate_; |
| 42 } | 45 } |
| 43 | 46 |
| 44 QuicBandwidth MaxBandwidthEstimate() const { | 47 QuicBandwidth MaxBandwidthEstimate() const { |
| 45 DCHECK(has_estimate_); | 48 DCHECK(has_estimate_); |
| 46 return max_bandwidth_estimate_; | 49 return max_bandwidth_estimate_; |
| 47 } | 50 } |
| 48 | 51 |
| 49 int64 MaxBandwidthTimestamp() const { | 52 int64_t MaxBandwidthTimestamp() const { |
| 50 DCHECK(has_estimate_); | 53 DCHECK(has_estimate_); |
| 51 return max_bandwidth_timestamp_; | 54 return max_bandwidth_timestamp_; |
| 52 } | 55 } |
| 53 | 56 |
| 54 bool EstimateRecordedDuringSlowStart() const { | 57 bool EstimateRecordedDuringSlowStart() const { |
| 55 DCHECK(has_estimate_); | 58 DCHECK(has_estimate_); |
| 56 return bandwidth_estimate_recorded_during_slow_start_; | 59 return bandwidth_estimate_recorded_during_slow_start_; |
| 57 } | 60 } |
| 58 | 61 |
| 59 private: | 62 private: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 70 // slow start. | 73 // slow start. |
| 71 bool bandwidth_estimate_recorded_during_slow_start_; | 74 bool bandwidth_estimate_recorded_during_slow_start_; |
| 72 | 75 |
| 73 // The latest sustained bandwidth estimate. | 76 // The latest sustained bandwidth estimate. |
| 74 QuicBandwidth bandwidth_estimate_; | 77 QuicBandwidth bandwidth_estimate_; |
| 75 | 78 |
| 76 // The maximum sustained bandwidth seen over the lifetime of the connection. | 79 // The maximum sustained bandwidth seen over the lifetime of the connection. |
| 77 QuicBandwidth max_bandwidth_estimate_; | 80 QuicBandwidth max_bandwidth_estimate_; |
| 78 | 81 |
| 79 // Timestamp indicating when the max_bandwidth_estimate_ was seen. | 82 // Timestamp indicating when the max_bandwidth_estimate_ was seen. |
| 80 int64 max_bandwidth_timestamp_; | 83 int64_t max_bandwidth_timestamp_; |
| 81 | 84 |
| 82 // Timestamp marking the beginning of the latest recording period. | 85 // Timestamp marking the beginning of the latest recording period. |
| 83 QuicTime start_time_; | 86 QuicTime start_time_; |
| 84 | 87 |
| 85 DISALLOW_COPY_AND_ASSIGN(QuicSustainedBandwidthRecorder); | 88 DISALLOW_COPY_AND_ASSIGN(QuicSustainedBandwidthRecorder); |
| 86 }; | 89 }; |
| 87 | 90 |
| 88 } // namespace net | 91 } // namespace net |
| 89 | 92 |
| 90 #endif // NET_QUIC_QUIC_SUSTAINED_BANDWIDTH_RECORDER_H_ | 93 #endif // NET_QUIC_QUIC_SUSTAINED_BANDWIDTH_RECORDER_H_ |
| OLD | NEW |