Chromium Code Reviews| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 113 NetworkQualityObservationSource source) = 0; | 113 NetworkQualityObservationSource source) = 0; |
| 114 | 114 |
| 115 protected: | 115 protected: |
| 116 ThroughputObserver() {} | 116 ThroughputObserver() {} |
| 117 virtual ~ThroughputObserver() {} | 117 virtual ~ThroughputObserver() {} |
| 118 | 118 |
| 119 private: | 119 private: |
| 120 DISALLOW_COPY_AND_ASSIGN(ThroughputObserver); | 120 DISALLOW_COPY_AND_ASSIGN(ThroughputObserver); |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 // Provides simple interface to obtain the effective connection type. | |
| 124 class NET_EXPORT NetworkQualityProvider { | |
| 125 public: | |
| 126 // Returns the current effective connection type. | |
| 127 virtual EffectiveConnectionType GetEffectiveConnectionType() = 0; | |
|
RyanSturm
2016/09/19 17:15:40
Can this be a const function?
dougarnett
2016/09/19 19:34:33
Done.
| |
| 128 | |
| 129 virtual ~NetworkQualityProvider() {} | |
| 130 | |
| 131 protected: | |
| 132 NetworkQualityProvider() {} | |
| 133 | |
| 134 private: | |
| 135 DISALLOW_COPY_AND_ASSIGN(NetworkQualityProvider); | |
| 136 }; | |
| 137 | |
| 123 // Creates a new NetworkQualityEstimator. | 138 // Creates a new NetworkQualityEstimator. |
| 124 // |variation_params| is the map containing all field trial parameters | 139 // |variation_params| is the map containing all field trial parameters |
| 125 // related to NetworkQualityEstimator field trial. | 140 // related to NetworkQualityEstimator field trial. |
| 126 // |external_estimates_provider| may be NULL. | 141 // |external_estimates_provider| may be NULL. |
| 127 NetworkQualityEstimator( | 142 NetworkQualityEstimator( |
| 128 std::unique_ptr<ExternalEstimateProvider> external_estimates_provider, | 143 std::unique_ptr<ExternalEstimateProvider> external_estimates_provider, |
| 129 const std::map<std::string, std::string>& variation_params); | 144 const std::map<std::string, std::string>& variation_params); |
| 130 | 145 |
| 131 // Construct a NetworkQualityEstimator instance allowing for test | 146 // Construct a NetworkQualityEstimator instance allowing for test |
| 132 // configuration. Registers for network type change notifications so estimates | 147 // configuration. Registers for network type change notifications so estimates |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 628 base::ThreadChecker thread_checker_; | 643 base::ThreadChecker thread_checker_; |
| 629 | 644 |
| 630 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_; | 645 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_; |
| 631 | 646 |
| 632 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); | 647 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); |
| 633 }; | 648 }; |
| 634 | 649 |
| 635 } // namespace net | 650 } // namespace net |
| 636 | 651 |
| 637 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ | 652 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ |
| OLD | NEW |