| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_NQE_NETWORK_QUALITY_ESTIMATOR_H_ | 5 #ifndef NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ |
| 6 #define NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ | 6 #define NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 ThroughputObserver() {} | 150 ThroughputObserver() {} |
| 151 virtual ~ThroughputObserver() {} | 151 virtual ~ThroughputObserver() {} |
| 152 | 152 |
| 153 private: | 153 private: |
| 154 DISALLOW_COPY_AND_ASSIGN(ThroughputObserver); | 154 DISALLOW_COPY_AND_ASSIGN(ThroughputObserver); |
| 155 }; | 155 }; |
| 156 | 156 |
| 157 // Provides simple interface to obtain the effective connection type. | 157 // Provides simple interface to obtain the effective connection type. |
| 158 class NET_EXPORT NetworkQualityProvider { | 158 class NET_EXPORT NetworkQualityProvider { |
| 159 public: | 159 public: |
| 160 virtual ~NetworkQualityProvider() {} |
| 161 |
| 160 // Returns the current effective connection type. | 162 // Returns the current effective connection type. |
| 161 virtual EffectiveConnectionType GetEffectiveConnectionType() const = 0; | 163 virtual EffectiveConnectionType GetEffectiveConnectionType() const = 0; |
| 162 | 164 |
| 163 virtual ~NetworkQualityProvider() {} | |
| 164 | |
| 165 // Adds |observer| to a list of effective connection type observers. | 165 // Adds |observer| to a list of effective connection type observers. |
| 166 virtual void AddEffectiveConnectionTypeObserver( | 166 virtual void AddEffectiveConnectionTypeObserver( |
| 167 EffectiveConnectionTypeObserver* observer) = 0; | 167 EffectiveConnectionTypeObserver* observer) = 0; |
| 168 | 168 |
| 169 // Removes |observer| from a list of effective connection type observers. | 169 // Removes |observer| from a list of effective connection type observers. |
| 170 virtual void RemoveEffectiveConnectionTypeObserver( | 170 virtual void RemoveEffectiveConnectionTypeObserver( |
| 171 EffectiveConnectionTypeObserver* observer) = 0; | 171 EffectiveConnectionTypeObserver* observer) = 0; |
| 172 | 172 |
| 173 // Sets |http_rtt| to the current HTTP RTT estimate. |http_rtt| should not |
| 174 // be null. Returns true only if a valid value is available. |
| 175 virtual bool GetHttpRTT(base::TimeDelta* http_rtt) const WARN_UNUSED_RESULT; |
| 176 |
| 177 // Sets |transport_rtt| to the current transport RTT estimate. |
| 178 // |transport_rtt| should not be null. Returns true only if a valid value is |
| 179 // available. |
| 180 virtual bool GetTransportRTT(base::TimeDelta* transport_rtt) const |
| 181 WARN_UNUSED_RESULT; |
| 182 |
| 183 // Sets |downstream_throughput_kbps| to the current downstream throughput |
| 184 // estimate (in kilobits per second). |downstream_throughput_kbps| should |
| 185 // not be null. Returns true only if a valid value is available. |
| 186 virtual bool GetDownstreamThroughputKbps( |
| 187 int32_t* downstream_throughput_kbps) const WARN_UNUSED_RESULT; |
| 188 |
| 173 // Adds |observer| to the list of RTT and throughput estimate observers. | 189 // Adds |observer| to the list of RTT and throughput estimate observers. |
| 174 // |observer| would be notified of the current RTT and throughput estimates | 190 // |observer| would be notified of the current RTT and throughput estimates |
| 175 // in the next message pump. | 191 // in the next message pump. |
| 176 virtual void AddRTTAndThroughputEstimatesObserver( | 192 virtual void AddRTTAndThroughputEstimatesObserver( |
| 177 RTTAndThroughputEstimatesObserver* observer) = 0; | 193 RTTAndThroughputEstimatesObserver* observer) = 0; |
| 178 | 194 |
| 179 // Removes |observer| from the list of RTT and throughput estimate | 195 // Removes |observer| from the list of RTT and throughput estimate |
| 180 // observers. | 196 // observers. |
| 181 virtual void RemoveRTTAndThroughputEstimatesObserver( | 197 virtual void RemoveRTTAndThroughputEstimatesObserver( |
| 182 RTTAndThroughputEstimatesObserver* observer) = 0; | 198 RTTAndThroughputEstimatesObserver* observer) = 0; |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 disallowed_observation_sources_for_transport_; | 834 disallowed_observation_sources_for_transport_; |
| 819 | 835 |
| 820 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_; | 836 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_; |
| 821 | 837 |
| 822 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); | 838 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); |
| 823 }; | 839 }; |
| 824 | 840 |
| 825 } // namespace net | 841 } // namespace net |
| 826 | 842 |
| 827 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ | 843 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ |
| OLD | NEW |