| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_params.h" | 5 #include "net/nqe/network_quality_estimator_params.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 | 11 |
| 12 namespace net { | 12 namespace net { |
| 13 | 13 |
| 14 const char kForceEffectiveConnectionType[] = "force_effective_connection_type"; | 14 const char kForceEffectiveConnectionType[] = "force_effective_connection_type"; |
| 15 | 15 |
| 16 namespace nqe { | |
| 17 | |
| 18 namespace internal { | |
| 19 | |
| 20 namespace { | 16 namespace { |
| 21 | 17 |
| 22 // Minimum valid value of the variation parameter that holds RTT (in | 18 // Minimum valid value of the variation parameter that holds RTT (in |
| 23 // milliseconds) values. | 19 // milliseconds) values. |
| 24 static const int kMinimumRTTVariationParameterMsec = 1; | 20 static const int kMinimumRTTVariationParameterMsec = 1; |
| 25 | 21 |
| 26 // Minimum valid value of the variation parameter that holds throughput (in | 22 // Minimum valid value of the variation parameter that holds throughput (in |
| 27 // kilobits per second) values. | 23 // kilobits per second) values. |
| 28 static const int kMinimumThroughputVariationParameterKbps = 1; | 24 static const int kMinimumThroughputVariationParameterKbps = 1; |
| 29 | 25 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 break; | 124 break; |
| 129 } | 125 } |
| 130 return ""; | 126 return ""; |
| 131 } | 127 } |
| 132 | 128 |
| 133 // Sets the default observation for different connection types in | 129 // Sets the default observation for different connection types in |
| 134 // |default_observations|. The default observations are different for | 130 // |default_observations|. The default observations are different for |
| 135 // different connection types (e.g., 2G, 3G, 4G, WiFi). The default | 131 // different connection types (e.g., 2G, 3G, 4G, WiFi). The default |
| 136 // observations may be used to determine the network quality in absence of any | 132 // observations may be used to determine the network quality in absence of any |
| 137 // other information. | 133 // other information. |
| 138 void ObtainDefaultObservations(const std::map<std::string, std::string>& params, | 134 void ObtainDefaultObservations( |
| 139 NetworkQuality default_observations[]) { | 135 const std::map<std::string, std::string>& params, |
| 136 nqe::internal::NetworkQuality default_observations[]) { |
| 140 for (size_t i = 0; i < NetworkChangeNotifier::CONNECTION_LAST; ++i) { | 137 for (size_t i = 0; i < NetworkChangeNotifier::CONNECTION_LAST; ++i) { |
| 141 DCHECK_EQ(InvalidRTT(), default_observations[i].http_rtt()); | 138 DCHECK_EQ(nqe::internal::InvalidRTT(), default_observations[i].http_rtt()); |
| 142 DCHECK_EQ(InvalidRTT(), default_observations[i].transport_rtt()); | 139 DCHECK_EQ(nqe::internal::InvalidRTT(), |
| 143 DCHECK_EQ(kInvalidThroughput, | 140 default_observations[i].transport_rtt()); |
| 141 DCHECK_EQ(nqe::internal::kInvalidThroughput, |
| 144 default_observations[i].downstream_throughput_kbps()); | 142 default_observations[i].downstream_throughput_kbps()); |
| 145 } | 143 } |
| 146 | 144 |
| 147 // Default observations for HTTP RTT, transport RTT, and downstream throughput | 145 // Default observations for HTTP RTT, transport RTT, and downstream throughput |
| 148 // Kbps for the various connection types. These may be overridden by | 146 // Kbps for the various connection types. These may be overridden by |
| 149 // variations params. The default observation for a connection type | 147 // variations params. The default observation for a connection type |
| 150 // corresponds to typical network quality for that connection type. | 148 // corresponds to typical network quality for that connection type. |
| 151 default_observations[NetworkChangeNotifier::CONNECTION_UNKNOWN] = | 149 default_observations[NetworkChangeNotifier::CONNECTION_UNKNOWN] = |
| 152 NetworkQuality(base::TimeDelta::FromMilliseconds(115), | 150 nqe::internal::NetworkQuality(base::TimeDelta::FromMilliseconds(115), |
| 153 base::TimeDelta::FromMilliseconds(55), 1961); | 151 base::TimeDelta::FromMilliseconds(55), |
| 152 1961); |
| 154 | 153 |
| 155 default_observations[NetworkChangeNotifier::CONNECTION_ETHERNET] = | 154 default_observations[NetworkChangeNotifier::CONNECTION_ETHERNET] = |
| 156 NetworkQuality(base::TimeDelta::FromMilliseconds(90), | 155 nqe::internal::NetworkQuality(base::TimeDelta::FromMilliseconds(90), |
| 157 base::TimeDelta::FromMilliseconds(33), 1456); | 156 base::TimeDelta::FromMilliseconds(33), |
| 157 1456); |
| 158 | 158 |
| 159 default_observations[NetworkChangeNotifier::CONNECTION_WIFI] = | 159 default_observations[NetworkChangeNotifier::CONNECTION_WIFI] = |
| 160 NetworkQuality(base::TimeDelta::FromMilliseconds(116), | 160 nqe::internal::NetworkQuality(base::TimeDelta::FromMilliseconds(116), |
| 161 base::TimeDelta::FromMilliseconds(66), 2658); | 161 base::TimeDelta::FromMilliseconds(66), |
| 162 2658); |
| 162 | 163 |
| 163 default_observations[NetworkChangeNotifier::CONNECTION_2G] = | 164 default_observations[NetworkChangeNotifier::CONNECTION_2G] = |
| 164 NetworkQuality(base::TimeDelta::FromMilliseconds(1726), | 165 nqe::internal::NetworkQuality(base::TimeDelta::FromMilliseconds(1726), |
| 165 base::TimeDelta::FromMilliseconds(1531), 74); | 166 base::TimeDelta::FromMilliseconds(1531), |
| 167 74); |
| 166 | 168 |
| 167 default_observations[NetworkChangeNotifier::CONNECTION_3G] = | 169 default_observations[NetworkChangeNotifier::CONNECTION_3G] = |
| 168 NetworkQuality(base::TimeDelta::FromMilliseconds(272), | 170 nqe::internal::NetworkQuality(base::TimeDelta::FromMilliseconds(272), |
| 169 base::TimeDelta::FromMilliseconds(209), 749); | 171 base::TimeDelta::FromMilliseconds(209), |
| 172 749); |
| 170 | 173 |
| 171 default_observations[NetworkChangeNotifier::CONNECTION_4G] = | 174 default_observations[NetworkChangeNotifier::CONNECTION_4G] = |
| 172 NetworkQuality(base::TimeDelta::FromMilliseconds(137), | 175 nqe::internal::NetworkQuality(base::TimeDelta::FromMilliseconds(137), |
| 173 base::TimeDelta::FromMilliseconds(80), 1708); | 176 base::TimeDelta::FromMilliseconds(80), |
| 177 1708); |
| 174 | 178 |
| 175 default_observations[NetworkChangeNotifier::CONNECTION_NONE] = | 179 default_observations[NetworkChangeNotifier::CONNECTION_NONE] = |
| 176 NetworkQuality(base::TimeDelta::FromMilliseconds(163), | 180 nqe::internal::NetworkQuality(base::TimeDelta::FromMilliseconds(163), |
| 177 base::TimeDelta::FromMilliseconds(83), 575); | 181 base::TimeDelta::FromMilliseconds(83), 575); |
| 178 | 182 |
| 179 default_observations[NetworkChangeNotifier::CONNECTION_BLUETOOTH] = | 183 default_observations[NetworkChangeNotifier::CONNECTION_BLUETOOTH] = |
| 180 NetworkQuality(base::TimeDelta::FromMilliseconds(385), | 184 nqe::internal::NetworkQuality(base::TimeDelta::FromMilliseconds(385), |
| 181 base::TimeDelta::FromMilliseconds(318), 476); | 185 base::TimeDelta::FromMilliseconds(318), |
| 186 476); |
| 182 | 187 |
| 183 // Override using the values provided via variation params. | 188 // Override using the values provided via variation params. |
| 184 for (size_t i = 0; i <= NetworkChangeNotifier::CONNECTION_LAST; ++i) { | 189 for (size_t i = 0; i <= NetworkChangeNotifier::CONNECTION_LAST; ++i) { |
| 185 NetworkChangeNotifier::ConnectionType type = | 190 NetworkChangeNotifier::ConnectionType type = |
| 186 static_cast<NetworkChangeNotifier::ConnectionType>(i); | 191 static_cast<NetworkChangeNotifier::ConnectionType>(i); |
| 187 | 192 |
| 188 int32_t variations_value = kMinimumRTTVariationParameterMsec - 1; | 193 int32_t variations_value = kMinimumRTTVariationParameterMsec - 1; |
| 189 std::string parameter_name = | 194 std::string parameter_name = |
| 190 std::string(GetNameForConnectionTypeInternal(type)) | 195 std::string(GetNameForConnectionTypeInternal(type)) |
| 191 .append(".DefaultMedianRTTMsec"); | 196 .append(".DefaultMedianRTTMsec"); |
| 192 auto it = params.find(parameter_name); | 197 auto it = params.find(parameter_name); |
| 193 if (it != params.end() && | 198 if (it != params.end() && |
| 194 base::StringToInt(it->second, &variations_value) && | 199 base::StringToInt(it->second, &variations_value) && |
| 195 variations_value >= kMinimumRTTVariationParameterMsec) { | 200 variations_value >= kMinimumRTTVariationParameterMsec) { |
| 196 default_observations[i] = | 201 default_observations[i] = nqe::internal::NetworkQuality( |
| 197 NetworkQuality(base::TimeDelta::FromMilliseconds(variations_value), | 202 base::TimeDelta::FromMilliseconds(variations_value), |
| 198 default_observations[i].transport_rtt(), | 203 default_observations[i].transport_rtt(), |
| 199 default_observations[i].downstream_throughput_kbps()); | 204 default_observations[i].downstream_throughput_kbps()); |
| 200 } | 205 } |
| 201 | 206 |
| 202 variations_value = kMinimumRTTVariationParameterMsec - 1; | 207 variations_value = kMinimumRTTVariationParameterMsec - 1; |
| 203 parameter_name = std::string(GetNameForConnectionTypeInternal(type)) | 208 parameter_name = std::string(GetNameForConnectionTypeInternal(type)) |
| 204 .append(".DefaultMedianTransportRTTMsec"); | 209 .append(".DefaultMedianTransportRTTMsec"); |
| 205 it = params.find(parameter_name); | 210 it = params.find(parameter_name); |
| 206 if (it != params.end() && | 211 if (it != params.end() && |
| 207 base::StringToInt(it->second, &variations_value) && | 212 base::StringToInt(it->second, &variations_value) && |
| 208 variations_value >= kMinimumRTTVariationParameterMsec) { | 213 variations_value >= kMinimumRTTVariationParameterMsec) { |
| 209 default_observations[i] = | 214 default_observations[i] = nqe::internal::NetworkQuality( |
| 210 NetworkQuality(default_observations[i].http_rtt(), | 215 default_observations[i].http_rtt(), |
| 211 base::TimeDelta::FromMilliseconds(variations_value), | 216 base::TimeDelta::FromMilliseconds(variations_value), |
| 212 default_observations[i].downstream_throughput_kbps()); | 217 default_observations[i].downstream_throughput_kbps()); |
| 213 } | 218 } |
| 214 | 219 |
| 215 variations_value = kMinimumThroughputVariationParameterKbps - 1; | 220 variations_value = kMinimumThroughputVariationParameterKbps - 1; |
| 216 parameter_name = std::string(GetNameForConnectionTypeInternal(type)) | 221 parameter_name = std::string(GetNameForConnectionTypeInternal(type)) |
| 217 .append(".DefaultMedianKbps"); | 222 .append(".DefaultMedianKbps"); |
| 218 it = params.find(parameter_name); | 223 it = params.find(parameter_name); |
| 219 | 224 |
| 220 if (it != params.end() && | 225 if (it != params.end() && |
| 221 base::StringToInt(it->second, &variations_value) && | 226 base::StringToInt(it->second, &variations_value) && |
| 222 variations_value >= kMinimumThroughputVariationParameterKbps) { | 227 variations_value >= kMinimumThroughputVariationParameterKbps) { |
| 223 default_observations[i] = NetworkQuality( | 228 default_observations[i] = nqe::internal::NetworkQuality( |
| 224 default_observations[i].http_rtt(), | 229 default_observations[i].http_rtt(), |
| 225 default_observations[i].transport_rtt(), variations_value); | 230 default_observations[i].transport_rtt(), variations_value); |
| 226 } | 231 } |
| 227 } | 232 } |
| 228 } | 233 } |
| 229 | 234 |
| 230 // Sets |typical_network_quality| to typical network quality for different | 235 // Sets |typical_network_quality| to typical network quality for different |
| 231 // effective connection types. | 236 // effective connection types. |
| 232 void ObtainTypicalNetworkQualities( | 237 void ObtainTypicalNetworkQualities( |
| 233 const std::map<std::string, std::string>& params, | 238 const std::map<std::string, std::string>& params, |
| 234 NetworkQuality typical_network_quality[]) { | 239 nqe::internal::NetworkQuality typical_network_quality[]) { |
| 235 for (size_t i = 0; i < EFFECTIVE_CONNECTION_TYPE_LAST; ++i) { | 240 for (size_t i = 0; i < EFFECTIVE_CONNECTION_TYPE_LAST; ++i) { |
| 236 DCHECK_EQ(InvalidRTT(), typical_network_quality[i].http_rtt()); | 241 DCHECK_EQ(nqe::internal::InvalidRTT(), |
| 237 DCHECK_EQ(InvalidRTT(), typical_network_quality[i].transport_rtt()); | 242 typical_network_quality[i].http_rtt()); |
| 238 DCHECK_EQ(kInvalidThroughput, | 243 DCHECK_EQ(nqe::internal::InvalidRTT(), |
| 244 typical_network_quality[i].transport_rtt()); |
| 245 DCHECK_EQ(nqe::internal::kInvalidThroughput, |
| 239 typical_network_quality[i].downstream_throughput_kbps()); | 246 typical_network_quality[i].downstream_throughput_kbps()); |
| 240 } | 247 } |
| 241 | 248 |
| 242 typical_network_quality[EFFECTIVE_CONNECTION_TYPE_SLOW_2G] = NetworkQuality( | 249 typical_network_quality[EFFECTIVE_CONNECTION_TYPE_SLOW_2G] = |
| 243 // Set to the 77.5th percentile of 2G RTT observations on Android. | 250 nqe::internal::NetworkQuality( |
| 244 // This corresponds to the median RTT observation when effective | 251 // Set to the 77.5th percentile of 2G RTT observations on Android. |
| 245 // connection type is Slow 2G. | 252 // This corresponds to the median RTT observation when effective |
| 246 base::TimeDelta::FromMilliseconds(3600), | 253 // connection type is Slow 2G. |
| 247 base::TimeDelta::FromMilliseconds(3000), 40); | 254 base::TimeDelta::FromMilliseconds(3600), |
| 255 base::TimeDelta::FromMilliseconds(3000), 40); |
| 248 | 256 |
| 249 typical_network_quality[EFFECTIVE_CONNECTION_TYPE_2G] = NetworkQuality( | 257 typical_network_quality[EFFECTIVE_CONNECTION_TYPE_2G] = |
| 250 // Set to the 58th percentile of 2G RTT observations on Android. This | 258 nqe::internal::NetworkQuality( |
| 251 // corresponds to the median RTT observation when effective connection | 259 // Set to the 58th percentile of 2G RTT observations on Android. This |
| 252 // type is 2G. | 260 // corresponds to the median RTT observation when effective connection |
| 253 base::TimeDelta::FromMilliseconds(1800), | 261 // type is 2G. |
| 254 base::TimeDelta::FromMilliseconds(1500), 75); | 262 base::TimeDelta::FromMilliseconds(1800), |
| 263 base::TimeDelta::FromMilliseconds(1500), 75); |
| 255 | 264 |
| 256 typical_network_quality[EFFECTIVE_CONNECTION_TYPE_3G] = NetworkQuality( | 265 typical_network_quality[EFFECTIVE_CONNECTION_TYPE_3G] = |
| 257 // Set to the 75th percentile of 3G RTT observations on Android. This | 266 nqe::internal::NetworkQuality( |
| 258 // corresponds to the median RTT observation when effective connection | 267 // Set to the 75th percentile of 3G RTT observations on Android. This |
| 259 // type is 3G. | 268 // corresponds to the median RTT observation when effective connection |
| 260 base::TimeDelta::FromMilliseconds(450), | 269 // type is 3G. |
| 261 base::TimeDelta::FromMilliseconds(400), 400); | 270 base::TimeDelta::FromMilliseconds(450), |
| 271 base::TimeDelta::FromMilliseconds(400), 400); |
| 262 | 272 |
| 263 // Set to the 25th percentile of 3G RTT observations on Android. | 273 // Set to the 25th percentile of 3G RTT observations on Android. |
| 264 typical_network_quality[EFFECTIVE_CONNECTION_TYPE_4G] = | 274 typical_network_quality[EFFECTIVE_CONNECTION_TYPE_4G] = |
| 265 NetworkQuality(base::TimeDelta::FromMilliseconds(175), | 275 nqe::internal::NetworkQuality(base::TimeDelta::FromMilliseconds(175), |
| 266 base::TimeDelta::FromMilliseconds(125), 1600); | 276 base::TimeDelta::FromMilliseconds(125), |
| 277 1600); |
| 267 | 278 |
| 268 static_assert( | 279 static_assert( |
| 269 EFFECTIVE_CONNECTION_TYPE_4G + 1 == EFFECTIVE_CONNECTION_TYPE_LAST, | 280 EFFECTIVE_CONNECTION_TYPE_4G + 1 == EFFECTIVE_CONNECTION_TYPE_LAST, |
| 270 "Missing effective connection type"); | 281 "Missing effective connection type"); |
| 271 } | 282 } |
| 272 | 283 |
| 273 // Sets the thresholds for different effective connection types in | 284 // Sets the thresholds for different effective connection types in |
| 274 // |connection_thresholds|. | 285 // |connection_thresholds|. |
| 275 void ObtainConnectionThresholds( | 286 void ObtainConnectionThresholds( |
| 276 const std::map<std::string, std::string>& params, | 287 const std::map<std::string, std::string>& params, |
| 277 NetworkQuality connection_thresholds[]) { | 288 nqe::internal::NetworkQuality connection_thresholds[]) { |
| 278 // First set the default thresholds. | 289 // First set the default thresholds. |
| 279 NetworkQuality default_effective_connection_type_thresholds | 290 nqe::internal::NetworkQuality default_effective_connection_type_thresholds |
| 280 [EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_LAST]; | 291 [EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_LAST]; |
| 281 | 292 |
| 282 default_effective_connection_type_thresholds | 293 default_effective_connection_type_thresholds |
| 283 [EFFECTIVE_CONNECTION_TYPE_SLOW_2G] = NetworkQuality( | 294 [EFFECTIVE_CONNECTION_TYPE_SLOW_2G] = nqe::internal::NetworkQuality( |
| 284 // Set to the 66th percentile of 2G RTT observations on Android. | 295 // Set to the 66th percentile of 2G RTT observations on Android. |
| 285 base::TimeDelta::FromMilliseconds(2010), | 296 base::TimeDelta::FromMilliseconds(2010), |
| 286 base::TimeDelta::FromMilliseconds(1870), kInvalidThroughput); | 297 base::TimeDelta::FromMilliseconds(1870), |
| 298 nqe::internal::kInvalidThroughput); |
| 287 | 299 |
| 288 default_effective_connection_type_thresholds[EFFECTIVE_CONNECTION_TYPE_2G] = | 300 default_effective_connection_type_thresholds[EFFECTIVE_CONNECTION_TYPE_2G] = |
| 289 NetworkQuality( | 301 nqe::internal::NetworkQuality( |
| 290 // Set to the 50th percentile of RTT observations on Android. | 302 // Set to the 50th percentile of RTT observations on Android. |
| 291 base::TimeDelta::FromMilliseconds(1420), | 303 base::TimeDelta::FromMilliseconds(1420), |
| 292 base::TimeDelta::FromMilliseconds(1280), kInvalidThroughput); | 304 base::TimeDelta::FromMilliseconds(1280), |
| 305 nqe::internal::kInvalidThroughput); |
| 293 | 306 |
| 294 default_effective_connection_type_thresholds[EFFECTIVE_CONNECTION_TYPE_3G] = | 307 default_effective_connection_type_thresholds[EFFECTIVE_CONNECTION_TYPE_3G] = |
| 295 NetworkQuality( | 308 nqe::internal::NetworkQuality( |
| 296 // Set to the 50th percentile of 3G RTT observations on Android. | 309 // Set to the 50th percentile of 3G RTT observations on Android. |
| 297 base::TimeDelta::FromMilliseconds(273), | 310 base::TimeDelta::FromMilliseconds(273), |
| 298 base::TimeDelta::FromMilliseconds(204), kInvalidThroughput); | 311 base::TimeDelta::FromMilliseconds(204), |
| 312 nqe::internal::kInvalidThroughput); |
| 299 | 313 |
| 300 // Connection threshold should not be set for 4G effective connection type | 314 // Connection threshold should not be set for 4G effective connection type |
| 301 // since it is the fastest. | 315 // since it is the fastest. |
| 302 static_assert( | 316 static_assert( |
| 303 EFFECTIVE_CONNECTION_TYPE_3G + 1 == EFFECTIVE_CONNECTION_TYPE_4G, | 317 EFFECTIVE_CONNECTION_TYPE_3G + 1 == EFFECTIVE_CONNECTION_TYPE_4G, |
| 304 "Missing effective connection type"); | 318 "Missing effective connection type"); |
| 305 static_assert( | 319 static_assert( |
| 306 EFFECTIVE_CONNECTION_TYPE_4G + 1 == EFFECTIVE_CONNECTION_TYPE_LAST, | 320 EFFECTIVE_CONNECTION_TYPE_4G + 1 == EFFECTIVE_CONNECTION_TYPE_LAST, |
| 307 "Missing effective connection type"); | 321 "Missing effective connection type"); |
| 308 for (size_t i = 0; i <= EFFECTIVE_CONNECTION_TYPE_3G; ++i) { | 322 for (size_t i = 0; i <= EFFECTIVE_CONNECTION_TYPE_3G; ++i) { |
| 309 EffectiveConnectionType effective_connection_type = | 323 EffectiveConnectionType effective_connection_type = |
| 310 static_cast<EffectiveConnectionType>(i); | 324 static_cast<EffectiveConnectionType>(i); |
| 311 DCHECK_EQ(InvalidRTT(), connection_thresholds[i].http_rtt()); | 325 DCHECK_EQ(nqe::internal::InvalidRTT(), connection_thresholds[i].http_rtt()); |
| 312 DCHECK_EQ(InvalidRTT(), connection_thresholds[i].transport_rtt()); | 326 DCHECK_EQ(nqe::internal::InvalidRTT(), |
| 313 DCHECK_EQ(kInvalidThroughput, | 327 connection_thresholds[i].transport_rtt()); |
| 328 DCHECK_EQ(nqe::internal::kInvalidThroughput, |
| 314 connection_thresholds[i].downstream_throughput_kbps()); | 329 connection_thresholds[i].downstream_throughput_kbps()); |
| 315 if (effective_connection_type == EFFECTIVE_CONNECTION_TYPE_UNKNOWN) | 330 if (effective_connection_type == EFFECTIVE_CONNECTION_TYPE_UNKNOWN) |
| 316 continue; | 331 continue; |
| 317 | 332 |
| 318 std::string connection_type_name = std::string( | 333 std::string connection_type_name = std::string( |
| 319 DeprecatedGetNameForEffectiveConnectionType(effective_connection_type)); | 334 DeprecatedGetNameForEffectiveConnectionType(effective_connection_type)); |
| 320 | 335 |
| 321 connection_thresholds[i].set_http_rtt( | 336 connection_thresholds[i].set_http_rtt( |
| 322 base::TimeDelta::FromMilliseconds(GetValueForVariationParam( | 337 base::TimeDelta::FromMilliseconds(GetValueForVariationParam( |
| 323 params, connection_type_name + ".ThresholdMedianHttpRTTMsec", | 338 params, connection_type_name + ".ThresholdMedianHttpRTTMsec", |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 return std::string(); | 424 return std::string(); |
| 410 return it->second; | 425 return it->second; |
| 411 } | 426 } |
| 412 | 427 |
| 413 // static | 428 // static |
| 414 const char* NetworkQualityEstimatorParams::GetNameForConnectionType( | 429 const char* NetworkQualityEstimatorParams::GetNameForConnectionType( |
| 415 NetworkChangeNotifier::ConnectionType connection_type) { | 430 NetworkChangeNotifier::ConnectionType connection_type) { |
| 416 return GetNameForConnectionTypeInternal(connection_type); | 431 return GetNameForConnectionTypeInternal(connection_type); |
| 417 } | 432 } |
| 418 | 433 |
| 419 const NetworkQuality& NetworkQualityEstimatorParams::DefaultObservation( | 434 const nqe::internal::NetworkQuality& |
| 435 NetworkQualityEstimatorParams::DefaultObservation( |
| 420 NetworkChangeNotifier::ConnectionType type) const { | 436 NetworkChangeNotifier::ConnectionType type) const { |
| 421 DCHECK(thread_checker_.CalledOnValidThread()); | 437 DCHECK(thread_checker_.CalledOnValidThread()); |
| 422 return default_observations_[type]; | 438 return default_observations_[type]; |
| 423 } | 439 } |
| 424 | 440 |
| 425 const NetworkQuality& NetworkQualityEstimatorParams::TypicalNetworkQuality( | 441 const nqe::internal::NetworkQuality& |
| 442 NetworkQualityEstimatorParams::TypicalNetworkQuality( |
| 426 EffectiveConnectionType type) const { | 443 EffectiveConnectionType type) const { |
| 427 DCHECK(thread_checker_.CalledOnValidThread()); | 444 DCHECK(thread_checker_.CalledOnValidThread()); |
| 428 return typical_network_quality_[type]; | 445 return typical_network_quality_[type]; |
| 429 } | 446 } |
| 430 | 447 |
| 431 const NetworkQuality& NetworkQualityEstimatorParams::ConnectionThreshold( | 448 const nqe::internal::NetworkQuality& |
| 449 NetworkQualityEstimatorParams::ConnectionThreshold( |
| 432 EffectiveConnectionType type) const { | 450 EffectiveConnectionType type) const { |
| 433 DCHECK(thread_checker_.CalledOnValidThread()); | 451 DCHECK(thread_checker_.CalledOnValidThread()); |
| 434 return connection_thresholds_[type]; | 452 return connection_thresholds_[type]; |
| 435 } | 453 } |
| 436 | 454 |
| 437 } // namespace internal | |
| 438 | |
| 439 } // namespace nqe | |
| 440 | |
| 441 } // namespace net | 455 } // namespace net |
| OLD | NEW |