| 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 #include "net/nqe/network_quality_estimator.h" | 5 #include "net/nqe/network_quality_estimator.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1061 NetworkQualityEstimator::GetRecentEffectiveConnectionTypeAndNetworkQuality( | 1061 NetworkQualityEstimator::GetRecentEffectiveConnectionTypeAndNetworkQuality( |
| 1062 const base::TimeTicks& start_time, | 1062 const base::TimeTicks& start_time, |
| 1063 base::TimeDelta* http_rtt, | 1063 base::TimeDelta* http_rtt, |
| 1064 base::TimeDelta* transport_rtt, | 1064 base::TimeDelta* transport_rtt, |
| 1065 int32_t* downstream_throughput_kbps) const { | 1065 int32_t* downstream_throughput_kbps) const { |
| 1066 DCHECK(thread_checker_.CalledOnValidThread()); | 1066 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1067 | 1067 |
| 1068 if (effective_connection_type_algorithm_ == | 1068 if (effective_connection_type_algorithm_ == |
| 1069 EffectiveConnectionTypeAlgorithm::HTTP_RTT_AND_DOWNSTREAM_THROUGHOUT) { | 1069 EffectiveConnectionTypeAlgorithm::HTTP_RTT_AND_DOWNSTREAM_THROUGHOUT) { |
| 1070 return GetRecentEffectiveConnectionTypeUsingMetrics( | 1070 return GetRecentEffectiveConnectionTypeUsingMetrics( |
| 1071 start_time, NetworkQualityEstimator::MetricUsage:: | 1071 start_time, |
| 1072 MUST_BE_USED /* http_rtt_metric */, | 1072 NetworkQualityEstimator::MetricUsage:: |
| 1073 MUST_BE_USED /* http_rtt_metric */, |
| 1073 NetworkQualityEstimator::MetricUsage:: | 1074 NetworkQualityEstimator::MetricUsage:: |
| 1074 DO_NOT_USE /* transport_rtt_metric */, | 1075 DO_NOT_USE /* transport_rtt_metric */, |
| 1075 NetworkQualityEstimator::MetricUsage:: | 1076 NetworkQualityEstimator::MetricUsage:: |
| 1076 MUST_BE_USED /* downstream_throughput_kbps_metric */, | 1077 USE_IF_AVAILABLE /* downstream_throughput_kbps_metric */, |
| 1077 http_rtt, transport_rtt, downstream_throughput_kbps); | 1078 http_rtt, transport_rtt, downstream_throughput_kbps); |
| 1078 } | 1079 } |
| 1079 if (effective_connection_type_algorithm_ == | 1080 if (effective_connection_type_algorithm_ == |
| 1080 EffectiveConnectionTypeAlgorithm:: | 1081 EffectiveConnectionTypeAlgorithm:: |
| 1081 TRANSPORT_RTT_OR_DOWNSTREAM_THROUGHOUT) { | 1082 TRANSPORT_RTT_OR_DOWNSTREAM_THROUGHOUT) { |
| 1082 return GetRecentEffectiveConnectionTypeUsingMetrics( | 1083 return GetRecentEffectiveConnectionTypeUsingMetrics( |
| 1083 start_time, | 1084 start_time, |
| 1084 NetworkQualityEstimator::MetricUsage::DO_NOT_USE /* http_rtt_metric */, | 1085 NetworkQualityEstimator::MetricUsage::DO_NOT_USE /* http_rtt_metric */, |
| 1085 NetworkQualityEstimator::MetricUsage:: | 1086 NetworkQualityEstimator::MetricUsage:: |
| 1086 USE_IF_AVAILABLE /* transport_rtt_metric */, | 1087 USE_IF_AVAILABLE /* transport_rtt_metric */, |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1702 NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP_CACHED_ESTIMATE); | 1703 NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP_CACHED_ESTIMATE); |
| 1703 downstream_throughput_kbps_observations_.AddObservation( | 1704 downstream_throughput_kbps_observations_.AddObservation( |
| 1704 throughput_observation); | 1705 throughput_observation); |
| 1705 NotifyObserversOfThroughput(throughput_observation); | 1706 NotifyObserversOfThroughput(throughput_observation); |
| 1706 } | 1707 } |
| 1707 | 1708 |
| 1708 ComputeEffectiveConnectionType(); | 1709 ComputeEffectiveConnectionType(); |
| 1709 } | 1710 } |
| 1710 | 1711 |
| 1711 } // namespace net | 1712 } // namespace net |
| OLD | NEW |