| 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" |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 DCHECK_NE(EffectiveConnectionTypeAlgorithm:: | 414 DCHECK_NE(EffectiveConnectionTypeAlgorithm:: |
| 415 EFFECTIVE_CONNECTION_TYPE_ALGORITHM_LAST, | 415 EFFECTIVE_CONNECTION_TYPE_ALGORITHM_LAST, |
| 416 effective_connection_type_algorithm_); | 416 effective_connection_type_algorithm_); |
| 417 | 417 |
| 418 ObtainDefaultObservations(params_, default_observations_); | 418 ObtainDefaultObservations(params_, default_observations_); |
| 419 ObtainTypicalNetworkQualities(params_, typical_network_quality_); | 419 ObtainTypicalNetworkQualities(params_, typical_network_quality_); |
| 420 ObtainConnectionThresholds(params_, connection_thresholds_); | 420 ObtainConnectionThresholds(params_, connection_thresholds_); |
| 421 } | 421 } |
| 422 | 422 |
| 423 NetworkQualityEstimatorParams::~NetworkQualityEstimatorParams() { | 423 NetworkQualityEstimatorParams::~NetworkQualityEstimatorParams() { |
| 424 DCHECK(thread_checker_.CalledOnValidThread()); | |
| 425 } | 424 } |
| 426 | 425 |
| 427 // static | 426 // static |
| 428 NetworkQualityEstimatorParams::EffectiveConnectionTypeAlgorithm | 427 NetworkQualityEstimatorParams::EffectiveConnectionTypeAlgorithm |
| 429 NetworkQualityEstimatorParams::GetEffectiveConnectionTypeAlgorithmFromString( | 428 NetworkQualityEstimatorParams::GetEffectiveConnectionTypeAlgorithmFromString( |
| 430 const std::string& algorithm_param_value) { | 429 const std::string& algorithm_param_value) { |
| 431 // The default algorithm to be used if the algorithm value is not available | 430 // The default algorithm to be used if the algorithm value is not available |
| 432 // through field trial parameters. | 431 // through field trial parameters. |
| 433 static const EffectiveConnectionTypeAlgorithm | 432 static const EffectiveConnectionTypeAlgorithm |
| 434 kDefaultEffectiveConnectionTypeAlgorithm = | 433 kDefaultEffectiveConnectionTypeAlgorithm = |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 return connection_thresholds_[type]; | 482 return connection_thresholds_[type]; |
| 484 } | 483 } |
| 485 | 484 |
| 486 NetworkQualityEstimatorParams::EffectiveConnectionTypeAlgorithm | 485 NetworkQualityEstimatorParams::EffectiveConnectionTypeAlgorithm |
| 487 NetworkQualityEstimatorParams::GetEffectiveConnectionTypeAlgorithm() const { | 486 NetworkQualityEstimatorParams::GetEffectiveConnectionTypeAlgorithm() const { |
| 488 DCHECK(thread_checker_.CalledOnValidThread()); | 487 DCHECK(thread_checker_.CalledOnValidThread()); |
| 489 return effective_connection_type_algorithm_; | 488 return effective_connection_type_algorithm_; |
| 490 } | 489 } |
| 491 | 490 |
| 492 } // namespace net | 491 } // namespace net |
| OLD | NEW |