| 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 // Returns the current HTTP RTT estimate. If the estimate is unavailable, |
| 174 // the returned optional value is null. |
| 175 virtual base::Optional<base::TimeDelta> GetHttpRTT() const; |
| 176 |
| 177 // Returns the current transport RTT estimate. If the estimate is |
| 178 // unavailable, the returned optional value is null. |
| 179 virtual base::Optional<base::TimeDelta> GetTransportRTT() const; |
| 180 |
| 181 // Returns the current downstream throughput estimate (in kilobits per |
| 182 // second). If the estimate is unavailable, the returned optional value is |
| 183 // null. |
| 184 virtual base::Optional<int32_t> GetDownstreamThroughputKbps() const; |
| 185 |
| 173 // Adds |observer| to the list of RTT and throughput estimate observers. | 186 // Adds |observer| to the list of RTT and throughput estimate observers. |
| 174 // |observer| would be notified of the current RTT and throughput estimates | 187 // |observer| would be notified of the current RTT and throughput estimates |
| 175 // in the next message pump. | 188 // in the next message pump. |
| 176 virtual void AddRTTAndThroughputEstimatesObserver( | 189 virtual void AddRTTAndThroughputEstimatesObserver( |
| 177 RTTAndThroughputEstimatesObserver* observer) = 0; | 190 RTTAndThroughputEstimatesObserver* observer) = 0; |
| 178 | 191 |
| 179 // Removes |observer| from the list of RTT and throughput estimate | 192 // Removes |observer| from the list of RTT and throughput estimate |
| 180 // observers. | 193 // observers. |
| 181 virtual void RemoveRTTAndThroughputEstimatesObserver( | 194 virtual void RemoveRTTAndThroughputEstimatesObserver( |
| 182 RTTAndThroughputEstimatesObserver* observer) = 0; | 195 RTTAndThroughputEstimatesObserver* observer) = 0; |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 disallowed_observation_sources_for_transport_; | 831 disallowed_observation_sources_for_transport_; |
| 819 | 832 |
| 820 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_; | 833 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_; |
| 821 | 834 |
| 822 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); | 835 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); |
| 823 }; | 836 }; |
| 824 | 837 |
| 825 } // namespace net | 838 } // namespace net |
| 826 | 839 |
| 827 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ | 840 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ |
| OLD | NEW |