| Index: net/nqe/network_quality_estimator.h
|
| diff --git a/net/nqe/network_quality_estimator.h b/net/nqe/network_quality_estimator.h
|
| index 57cf98b686864121b3e182072a49cc47a75ed2ba..d11b4841628cec93f6b83ffb75f15e6cd50f8035 100644
|
| --- a/net/nqe/network_quality_estimator.h
|
| +++ b/net/nqe/network_quality_estimator.h
|
| @@ -322,6 +322,8 @@ class NET_EXPORT_PRIVATE NetworkQualityEstimator
|
| FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, StoreObservations);
|
| FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, TestAddObservation);
|
| FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, ObtainOperatingParams);
|
| + FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest,
|
| + ObtainAlgorithmToUseFromParams);
|
| FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, HalfLifeParam);
|
| FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, ComputedPercentiles);
|
| FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, TestCaching);
|
| @@ -346,6 +348,23 @@ class NET_EXPORT_PRIVATE NetworkQualityEstimator
|
| typedef std::map<NetworkID, nqe::internal::CachedNetworkQuality>
|
| CachedNetworkQualities;
|
|
|
| + // Algorithms supported by network quality estimator for computing effective
|
| + // connection type.
|
| + enum class EffectiveConnectionTypeAlgorithm {
|
| + HTTP_RTT_AND_DOWNSTREAM_THROUGHOUT = 0,
|
| + EFFECTIVE_CONNECTION_TYPE_ALGORITHM_LAST
|
| + };
|
| +
|
| + // Map from algorithm names to EffectiveConnectionTypeAlgorithm.
|
| + const std::map<std::string, EffectiveConnectionTypeAlgorithm>
|
| + algorithm_name_to_enum_;
|
| +
|
| + // The default algorithm to be used if the algorithm value is not available
|
| + // through field trial parameters.
|
| + static const EffectiveConnectionTypeAlgorithm
|
| + kDefaultEffectiveConnectionTypeAlgorithm =
|
| + EffectiveConnectionTypeAlgorithm::HTTP_RTT_AND_DOWNSTREAM_THROUGHOUT;
|
| +
|
| // Minimum valid value of the variation parameter that holds RTT (in
|
| // milliseconds) values.
|
| static const int kMinimumRTTVariationParameterMsec = 1;
|
| @@ -443,6 +462,14 @@ class NET_EXPORT_PRIVATE NetworkQualityEstimator
|
| // main frame request is observed.
|
| void RecordAccuracyAfterMainFrame(base::TimeDelta measuring_duration) const;
|
|
|
| + // Returns the effective type of the current connection based on only the
|
| + // samples observed after |start_time|. Uses HTTP RTT and downstream
|
| + // throughput to compute the effective connection type, and requires both of
|
| + // them to have a valid value.
|
| + EffectiveConnectionType
|
| + GetRecentEffectiveConnectionTypeHttpRTTAndDownstreamThroughput(
|
| + const base::TimeTicks& start_time) const;
|
| +
|
| // Values of external estimate provider status. This enum must remain
|
| // synchronized with the enum of the same name in
|
| // metrics/histograms/histograms.xml.
|
| @@ -473,6 +500,12 @@ class NET_EXPORT_PRIVATE NetworkQualityEstimator
|
| // The factor by which the weight of an observation reduces every second.
|
| const double weight_multiplier_per_second_;
|
|
|
| + // Algorithm to use for computing effective connection type. The value is
|
| + // obtained from field trial parameters. If the value from field trial
|
| + // parameters is unavailable, it is set to
|
| + // kDefaultEffectiveConnectionTypeAlgorithm.
|
| + const EffectiveConnectionTypeAlgorithm effective_connection_type_algorithm_;
|
| +
|
| // Tick clock used by the network quality estimator.
|
| std::unique_ptr<base::TickClock> tick_clock_;
|
|
|
|
|