| 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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 static const int kMinimumRTTVariationParameterMsec = 1; | 373 static const int kMinimumRTTVariationParameterMsec = 1; |
| 374 | 374 |
| 375 // Minimum valid value of the variation parameter that holds throughput (in | 375 // Minimum valid value of the variation parameter that holds throughput (in |
| 376 // kilobits per second) values. | 376 // kilobits per second) values. |
| 377 static const int kMinimumThroughputVariationParameterKbps = 1; | 377 static const int kMinimumThroughputVariationParameterKbps = 1; |
| 378 | 378 |
| 379 // Returns the RTT value to be used when the valid RTT is unavailable. Readers | 379 // Returns the RTT value to be used when the valid RTT is unavailable. Readers |
| 380 // should discard RTT if it is set to the value returned by |InvalidRTT()|. | 380 // should discard RTT if it is set to the value returned by |InvalidRTT()|. |
| 381 static const base::TimeDelta InvalidRTT(); | 381 static const base::TimeDelta InvalidRTT(); |
| 382 | 382 |
| 383 // Queries external estimate provider for network quality. When the network |
| 384 // quality is available, OnUpdatedEstimateAvailable() is called. |
| 385 void MaybeQueryExternalEstimateProvider() const; |
| 386 |
| 383 // Records UMA when there is a change in connection type. | 387 // Records UMA when there is a change in connection type. |
| 384 void RecordMetricsOnConnectionTypeChanged() const; | 388 void RecordMetricsOnConnectionTypeChanged() const; |
| 385 | 389 |
| 386 // Records UMA on whether the NetworkID was available or not. Called right | 390 // Records UMA on whether the NetworkID was available or not. Called right |
| 387 // after a network change event. | 391 // after a network change event. |
| 388 void RecordNetworkIDAvailability() const; | 392 void RecordNetworkIDAvailability() const; |
| 389 | 393 |
| 390 // Records UMA on main frame requests. | 394 // Records UMA on main frame requests. |
| 391 void RecordMetricsOnMainFrameRequest() const; | 395 void RecordMetricsOnMainFrameRequest() const; |
| 392 | 396 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 connection_thresholds_[EFFECTIVE_CONNECTION_TYPE_LAST]; | 573 connection_thresholds_[EFFECTIVE_CONNECTION_TYPE_LAST]; |
| 570 | 574 |
| 571 // Latest time when the headers for a main frame request were received. | 575 // Latest time when the headers for a main frame request were received. |
| 572 base::TimeTicks last_main_frame_request_; | 576 base::TimeTicks last_main_frame_request_; |
| 573 | 577 |
| 574 // Estimated network quality when the response headers for the last mainframe | 578 // Estimated network quality when the response headers for the last mainframe |
| 575 // request were received. | 579 // request were received. |
| 576 nqe::internal::NetworkQuality estimated_quality_at_last_main_frame_; | 580 nqe::internal::NetworkQuality estimated_quality_at_last_main_frame_; |
| 577 EffectiveConnectionType effective_connection_type_at_last_main_frame_; | 581 EffectiveConnectionType effective_connection_type_at_last_main_frame_; |
| 578 | 582 |
| 583 // Estimated network quality obtained from external estimate provider when the |
| 584 // external estimate provider was last queried. |
| 585 nqe::internal::NetworkQuality external_estimate_provider_quality_; |
| 586 |
| 579 // ExternalEstimateProvider that provides network quality using operating | 587 // ExternalEstimateProvider that provides network quality using operating |
| 580 // system APIs. May be NULL. | 588 // system APIs. May be NULL. |
| 581 const std::unique_ptr<ExternalEstimateProvider> external_estimate_provider_; | 589 const std::unique_ptr<ExternalEstimateProvider> external_estimate_provider_; |
| 582 | 590 |
| 583 // Observer list for changes in effective connection type. | 591 // Observer list for changes in effective connection type. |
| 584 base::ObserverList<EffectiveConnectionTypeObserver> | 592 base::ObserverList<EffectiveConnectionTypeObserver> |
| 585 effective_connection_type_observer_list_; | 593 effective_connection_type_observer_list_; |
| 586 | 594 |
| 587 // Observer lists for round trip times and throughput measurements. | 595 // Observer lists for round trip times and throughput measurements. |
| 588 base::ObserverList<RTTObserver> rtt_observer_list_; | 596 base::ObserverList<RTTObserver> rtt_observer_list_; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 base::ThreadChecker thread_checker_; | 628 base::ThreadChecker thread_checker_; |
| 621 | 629 |
| 622 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_; | 630 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_; |
| 623 | 631 |
| 624 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); | 632 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); |
| 625 }; | 633 }; |
| 626 | 634 |
| 627 } // namespace net | 635 } // namespace net |
| 628 | 636 |
| 629 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ | 637 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ |
| OLD | NEW |