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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, | 247 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, |
248 PercentileSameTimestamps); | 248 PercentileSameTimestamps); |
249 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, | 249 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, |
250 PercentileDifferentTimestamps); | 250 PercentileDifferentTimestamps); |
251 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, ComputedPercentiles); | 251 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, ComputedPercentiles); |
252 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, TestCaching); | 252 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, TestCaching); |
253 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, | 253 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, |
254 TestLRUCacheMaximumSize); | 254 TestLRUCacheMaximumSize); |
255 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, TestGetMedianRTTSince); | 255 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, TestGetMedianRTTSince); |
256 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, | 256 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, |
257 TestExternalEstimateProvider); | |
258 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, | |
259 TestExternalEstimateProviderMergeEstimates); | 257 TestExternalEstimateProviderMergeEstimates); |
260 | 258 |
261 class SocketWatcher; | 259 class SocketWatcher; |
262 class SocketWatcherFactory; | 260 class SocketWatcherFactory; |
263 | 261 |
264 // NetworkQuality is used to cache the quality of a network connection. | 262 // NetworkQuality is used to cache the quality of a network connection. |
265 class NET_EXPORT_PRIVATE NetworkQuality { | 263 class NET_EXPORT_PRIVATE NetworkQuality { |
266 public: | 264 public: |
267 NetworkQuality(); | 265 NetworkQuality(); |
268 // |rtt| is the estimate of the round trip time. | 266 // |rtt| is the estimate of the round trip time. |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 | 549 |
552 // Values of external estimate provider status. This enum must remain | 550 // Values of external estimate provider status. This enum must remain |
553 // synchronized with the enum of the same name in | 551 // synchronized with the enum of the same name in |
554 // metrics/histograms/histograms.xml. | 552 // metrics/histograms/histograms.xml. |
555 enum NQEExternalEstimateProviderStatus { | 553 enum NQEExternalEstimateProviderStatus { |
556 EXTERNAL_ESTIMATE_PROVIDER_STATUS_NOT_AVAILABLE, | 554 EXTERNAL_ESTIMATE_PROVIDER_STATUS_NOT_AVAILABLE, |
557 EXTERNAL_ESTIMATE_PROVIDER_STATUS_AVAILABLE, | 555 EXTERNAL_ESTIMATE_PROVIDER_STATUS_AVAILABLE, |
558 EXTERNAL_ESTIMATE_PROVIDER_STATUS_QUERIED, | 556 EXTERNAL_ESTIMATE_PROVIDER_STATUS_QUERIED, |
559 EXTERNAL_ESTIMATE_PROVIDER_STATUS_QUERY_SUCCESSFUL, | 557 EXTERNAL_ESTIMATE_PROVIDER_STATUS_QUERY_SUCCESSFUL, |
560 EXTERNAL_ESTIMATE_PROVIDER_STATUS_CALLBACK, | 558 EXTERNAL_ESTIMATE_PROVIDER_STATUS_CALLBACK, |
| 559 EXTERNAL_ESTIMATE_PROVIDER_STATUS_RTT_AVAILABLE, |
| 560 EXTERNAL_ESTIMATE_PROVIDER_STATUS_DOWNLINK_BANDWIDTH_AVAILABLE, |
561 EXTERNAL_ESTIMATE_PROVIDER_STATUS_BOUNDARY | 561 EXTERNAL_ESTIMATE_PROVIDER_STATUS_BOUNDARY |
562 }; | 562 }; |
563 | 563 |
564 // Records the metrics related to external estimate provider. | 564 // Records the metrics related to external estimate provider. |
565 void RecordExternalEstimateProviderMetrics( | 565 void RecordExternalEstimateProviderMetrics( |
566 NQEExternalEstimateProviderStatus status) const; | 566 NQEExternalEstimateProviderStatus status) const; |
567 | 567 |
568 // Determines if the requests to local host can be used in estimating the | 568 // Determines if the requests to local host can be used in estimating the |
569 // network quality. Set to true only for tests. | 569 // network quality. Set to true only for tests. |
570 const bool allow_localhost_requests_; | 570 const bool allow_localhost_requests_; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 base::ThreadChecker thread_checker_; | 620 base::ThreadChecker thread_checker_; |
621 | 621 |
622 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_; | 622 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_; |
623 | 623 |
624 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); | 624 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); |
625 }; | 625 }; |
626 | 626 |
627 } // namespace net | 627 } // namespace net |
628 | 628 |
629 #endif // NET_BASE_NETWORK_QUALITY_ESTIMATOR_H_ | 629 #endif // NET_BASE_NETWORK_QUALITY_ESTIMATOR_H_ |
OLD | NEW |