| 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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 | 470 |
| 471 // Notify observers of a change in effective connection type. | 471 // Notify observers of a change in effective connection type. |
| 472 void NotifyObserversOfEffectiveConnectionTypeChanged(); | 472 void NotifyObserversOfEffectiveConnectionTypeChanged(); |
| 473 | 473 |
| 474 // Records NQE accuracy metrics. |measuring_duration| should belong to the | 474 // Records NQE accuracy metrics. |measuring_duration| should belong to the |
| 475 // vector returned by AccuracyRecordingIntervals(). | 475 // vector returned by AccuracyRecordingIntervals(). |
| 476 // RecordAccuracyAfterMainFrame should be called |measuring_duration| after a | 476 // RecordAccuracyAfterMainFrame should be called |measuring_duration| after a |
| 477 // main frame request is observed. | 477 // main frame request is observed. |
| 478 void RecordAccuracyAfterMainFrame(base::TimeDelta measuring_duration) const; | 478 void RecordAccuracyAfterMainFrame(base::TimeDelta measuring_duration) const; |
| 479 | 479 |
| 480 // Obtains the current cellular signal strength value and updates |
| 481 // |min_signal_strength_since_connection_change_| and |
| 482 // |max_signal_strength_since_connection_change_|. |
| 483 void UpdateSignalStrength(); |
| 484 |
| 480 // Returns the effective type of the current connection based on only the | 485 // Returns the effective type of the current connection based on only the |
| 481 // samples observed after |start_time|. Uses HTTP RTT and downstream | 486 // samples observed after |start_time|. Uses HTTP RTT and downstream |
| 482 // throughput to compute the effective connection type, and requires both of | 487 // throughput to compute the effective connection type, and requires both of |
| 483 // them to have a valid value. | 488 // them to have a valid value. |
| 484 EffectiveConnectionType | 489 EffectiveConnectionType |
| 485 GetRecentEffectiveConnectionTypeHttpRTTAndDownstreamThroughput( | 490 GetRecentEffectiveConnectionTypeHttpRTTAndDownstreamThroughput( |
| 486 const base::TimeTicks& start_time) const; | 491 const base::TimeTicks& start_time) const; |
| 487 | 492 |
| 488 // Values of external estimate provider status. This enum must remain | 493 // Values of external estimate provider status. This enum must remain |
| 489 // synchronized with the enum of the same name in | 494 // synchronized with the enum of the same name in |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 // |downstream_throughput_kbps_observations_|, which are later used for | 604 // |downstream_throughput_kbps_observations_|, which are later used for |
| 600 // estimating the throughput. | 605 // estimating the throughput. |
| 601 std::unique_ptr<nqe::internal::ThroughputAnalyzer> throughput_analyzer_; | 606 std::unique_ptr<nqe::internal::ThroughputAnalyzer> throughput_analyzer_; |
| 602 | 607 |
| 603 // Current effective connection type. It is updated on connection change | 608 // Current effective connection type. It is updated on connection change |
| 604 // events. It is also updated every time there is network traffic (provided | 609 // events. It is also updated every time there is network traffic (provided |
| 605 // the last computation was more than | 610 // the last computation was more than |
| 606 // |effective_connection_type_recomputation_interval_| ago). | 611 // |effective_connection_type_recomputation_interval_| ago). |
| 607 EffectiveConnectionType effective_connection_type_; | 612 EffectiveConnectionType effective_connection_type_; |
| 608 | 613 |
| 614 // Minimum and Maximum signal strength (in dbM) observed since last connection |
| 615 // change. Updated on connection change and main frame requests. |
| 616 int32_t min_signal_strength_since_connection_change_; |
| 617 int32_t max_signal_strength_since_connection_change_; |
| 618 |
| 609 base::ThreadChecker thread_checker_; | 619 base::ThreadChecker thread_checker_; |
| 610 | 620 |
| 611 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_; | 621 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_; |
| 612 | 622 |
| 613 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); | 623 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); |
| 614 }; | 624 }; |
| 615 | 625 |
| 616 } // namespace net | 626 } // namespace net |
| 617 | 627 |
| 618 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ | 628 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ |
| OLD | NEW |