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

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

Issue 2416473004: Add functionality for embedders to configure NQE (Closed)
Patch Set: mgersh comments Created 3 years, 5 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 | « net/nqe/network_quality_estimator_params.h ('k') | 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 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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 DCHECK_NE(EffectiveConnectionTypeAlgorithm:: 415 DCHECK_NE(EffectiveConnectionTypeAlgorithm::
416 EFFECTIVE_CONNECTION_TYPE_ALGORITHM_LAST, 416 EFFECTIVE_CONNECTION_TYPE_ALGORITHM_LAST,
417 effective_connection_type_algorithm_); 417 effective_connection_type_algorithm_);
418 418
419 ObtainDefaultObservations(params_, default_observations_); 419 ObtainDefaultObservations(params_, default_observations_);
420 ObtainTypicalNetworkQualities(params_, typical_network_quality_); 420 ObtainTypicalNetworkQualities(params_, typical_network_quality_);
421 ObtainConnectionThresholds(params_, connection_thresholds_); 421 ObtainConnectionThresholds(params_, connection_thresholds_);
422 } 422 }
423 423
424 NetworkQualityEstimatorParams::~NetworkQualityEstimatorParams() { 424 NetworkQualityEstimatorParams::~NetworkQualityEstimatorParams() {
425 DCHECK(thread_checker_.CalledOnValidThread());
426 } 425 }
427 426
428 // static 427 // static
429 NetworkQualityEstimatorParams::EffectiveConnectionTypeAlgorithm 428 NetworkQualityEstimatorParams::EffectiveConnectionTypeAlgorithm
430 NetworkQualityEstimatorParams::GetEffectiveConnectionTypeAlgorithmFromString( 429 NetworkQualityEstimatorParams::GetEffectiveConnectionTypeAlgorithmFromString(
431 const std::string& algorithm_param_value) { 430 const std::string& algorithm_param_value) {
432 // The default algorithm to be used if the algorithm value is not available 431 // The default algorithm to be used if the algorithm value is not available
433 // through field trial parameters. 432 // through field trial parameters.
434 static const EffectiveConnectionTypeAlgorithm 433 static const EffectiveConnectionTypeAlgorithm
435 kDefaultEffectiveConnectionTypeAlgorithm = 434 kDefaultEffectiveConnectionTypeAlgorithm =
(...skipping 23 matching lines...) Expand all
459 458
460 // static 459 // static
461 const char* NetworkQualityEstimatorParams::GetNameForConnectionType( 460 const char* NetworkQualityEstimatorParams::GetNameForConnectionType(
462 NetworkChangeNotifier::ConnectionType connection_type) { 461 NetworkChangeNotifier::ConnectionType connection_type) {
463 return GetNameForConnectionTypeInternal(connection_type); 462 return GetNameForConnectionTypeInternal(connection_type);
464 } 463 }
465 464
466 const nqe::internal::NetworkQuality& 465 const nqe::internal::NetworkQuality&
467 NetworkQualityEstimatorParams::DefaultObservation( 466 NetworkQualityEstimatorParams::DefaultObservation(
468 NetworkChangeNotifier::ConnectionType type) const { 467 NetworkChangeNotifier::ConnectionType type) const {
469 DCHECK(thread_checker_.CalledOnValidThread()); 468 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
470 return default_observations_[type]; 469 return default_observations_[type];
471 } 470 }
472 471
473 const nqe::internal::NetworkQuality& 472 const nqe::internal::NetworkQuality&
474 NetworkQualityEstimatorParams::TypicalNetworkQuality( 473 NetworkQualityEstimatorParams::TypicalNetworkQuality(
475 EffectiveConnectionType type) const { 474 EffectiveConnectionType type) const {
476 DCHECK(thread_checker_.CalledOnValidThread()); 475 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
477 return typical_network_quality_[type]; 476 return typical_network_quality_[type];
478 } 477 }
479 478
480 const nqe::internal::NetworkQuality& 479 const nqe::internal::NetworkQuality&
481 NetworkQualityEstimatorParams::ConnectionThreshold( 480 NetworkQualityEstimatorParams::ConnectionThreshold(
482 EffectiveConnectionType type) const { 481 EffectiveConnectionType type) const {
483 DCHECK(thread_checker_.CalledOnValidThread()); 482 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
484 return connection_thresholds_[type]; 483 return connection_thresholds_[type];
485 } 484 }
486 485
487 NetworkQualityEstimatorParams::EffectiveConnectionTypeAlgorithm 486 NetworkQualityEstimatorParams::EffectiveConnectionTypeAlgorithm
488 NetworkQualityEstimatorParams::GetEffectiveConnectionTypeAlgorithm() const { 487 NetworkQualityEstimatorParams::GetEffectiveConnectionTypeAlgorithm() const {
489 DCHECK(thread_checker_.CalledOnValidThread()); 488 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
490 return effective_connection_type_algorithm_; 489 return effective_connection_type_algorithm_;
491 } 490 }
492 491
493 } // namespace net 492 } // namespace net
OLDNEW
« no previous file with comments | « net/nqe/network_quality_estimator_params.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698