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_BASE_NETWORK_QUALITY_ESTIMATOR_H_ | 5 #ifndef NET_BASE_NETWORK_QUALITY_ESTIMATOR_H_ |
6 #define NET_BASE_NETWORK_QUALITY_ESTIMATOR_H_ | 6 #define NET_BASE_NETWORK_QUALITY_ESTIMATOR_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <deque> | 10 #include <deque> |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 }; | 189 }; |
190 | 190 |
191 // CachedNetworkQuality stores the quality of a previously seen network. | 191 // CachedNetworkQuality stores the quality of a previously seen network. |
192 class NET_EXPORT_PRIVATE CachedNetworkQuality { | 192 class NET_EXPORT_PRIVATE CachedNetworkQuality { |
193 public: | 193 public: |
194 explicit CachedNetworkQuality(const NetworkQuality& network_quality); | 194 explicit CachedNetworkQuality(const NetworkQuality& network_quality); |
195 CachedNetworkQuality(const CachedNetworkQuality& other); | 195 CachedNetworkQuality(const CachedNetworkQuality& other); |
196 ~CachedNetworkQuality(); | 196 ~CachedNetworkQuality(); |
197 | 197 |
198 // Returns the network quality associated with this cached entry. | 198 // Returns the network quality associated with this cached entry. |
199 const NetworkQuality network_quality() const { return network_quality_; } | 199 const NetworkQuality& network_quality() const { return network_quality_; } |
200 | 200 |
201 // Returns true if this cache entry was updated before | 201 // Returns true if this cache entry was updated before |
202 // |cached_network_quality|. | 202 // |cached_network_quality|. |
203 bool OlderThan(const CachedNetworkQuality& cached_network_quality) const; | 203 bool OlderThan(const CachedNetworkQuality& cached_network_quality) const; |
204 | 204 |
205 // Time when this cache entry was last updated. | 205 // Time when this cache entry was last updated. |
206 const base::TimeTicks last_update_time_; | 206 const base::TimeTicks last_update_time_; |
207 | 207 |
208 // Quality of this cached network. | 208 // Quality of this cached network. |
209 const NetworkQuality network_quality_; | 209 const NetworkQuality network_quality_; |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 const scoped_ptr<ExternalEstimateProvider> external_estimates_provider_; | 433 const scoped_ptr<ExternalEstimateProvider> external_estimates_provider_; |
434 | 434 |
435 base::ThreadChecker thread_checker_; | 435 base::ThreadChecker thread_checker_; |
436 | 436 |
437 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); | 437 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); |
438 }; | 438 }; |
439 | 439 |
440 } // namespace net | 440 } // namespace net |
441 | 441 |
442 #endif // NET_BASE_NETWORK_QUALITY_ESTIMATOR_H_ | 442 #endif // NET_BASE_NETWORK_QUALITY_ESTIMATOR_H_ |
OLD | NEW |