Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: net/nqe/network_quality_estimator.cc

Issue 2717883002: Make kbps optional when computing effective connection type (Closed)
Patch Set: ps Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after
1094 DCHECK(thread_checker_.CalledOnValidThread()); 1094 DCHECK(thread_checker_.CalledOnValidThread());
1095 1095
1096 if (effective_connection_type_algorithm_ == 1096 if (effective_connection_type_algorithm_ ==
1097 EffectiveConnectionTypeAlgorithm::HTTP_RTT_AND_DOWNSTREAM_THROUGHOUT) { 1097 EffectiveConnectionTypeAlgorithm::HTTP_RTT_AND_DOWNSTREAM_THROUGHOUT) {
1098 return GetRecentEffectiveConnectionTypeUsingMetrics( 1098 return GetRecentEffectiveConnectionTypeUsingMetrics(
1099 start_time, NetworkQualityEstimator::MetricUsage:: 1099 start_time, NetworkQualityEstimator::MetricUsage::
1100 MUST_BE_USED /* http_rtt_metric */, 1100 MUST_BE_USED /* http_rtt_metric */,
1101 NetworkQualityEstimator::MetricUsage:: 1101 NetworkQualityEstimator::MetricUsage::
1102 DO_NOT_USE /* transport_rtt_metric */, 1102 DO_NOT_USE /* transport_rtt_metric */,
1103 NetworkQualityEstimator::MetricUsage:: 1103 NetworkQualityEstimator::MetricUsage::
1104 MUST_BE_USED /* downstream_throughput_kbps_metric */, 1104 USE_IF_AVAILABLE /* downstream_throughput_kbps_metric */,
1105 http_rtt, transport_rtt, downstream_throughput_kbps); 1105 http_rtt, transport_rtt, downstream_throughput_kbps);
1106 } 1106 }
1107 if (effective_connection_type_algorithm_ == 1107 if (effective_connection_type_algorithm_ ==
1108 EffectiveConnectionTypeAlgorithm:: 1108 EffectiveConnectionTypeAlgorithm::
1109 TRANSPORT_RTT_OR_DOWNSTREAM_THROUGHOUT) { 1109 TRANSPORT_RTT_OR_DOWNSTREAM_THROUGHOUT) {
1110 return GetRecentEffectiveConnectionTypeUsingMetrics( 1110 return GetRecentEffectiveConnectionTypeUsingMetrics(
1111 start_time, 1111 start_time,
1112 NetworkQualityEstimator::MetricUsage::DO_NOT_USE /* http_rtt_metric */, 1112 NetworkQualityEstimator::MetricUsage::DO_NOT_USE /* http_rtt_metric */,
1113 NetworkQualityEstimator::MetricUsage:: 1113 NetworkQualityEstimator::MetricUsage::
1114 USE_IF_AVAILABLE /* transport_rtt_metric */, 1114 USE_IF_AVAILABLE /* transport_rtt_metric */,
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
1724 NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP_CACHED_ESTIMATE); 1724 NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP_CACHED_ESTIMATE);
1725 downstream_throughput_kbps_observations_.AddObservation( 1725 downstream_throughput_kbps_observations_.AddObservation(
1726 throughput_observation); 1726 throughput_observation);
1727 NotifyObserversOfThroughput(throughput_observation); 1727 NotifyObserversOfThroughput(throughput_observation);
1728 } 1728 }
1729 1729
1730 ComputeEffectiveConnectionType(); 1730 ComputeEffectiveConnectionType();
1731 } 1731 }
1732 1732
1733 } // namespace net 1733 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698