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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc

Issue 2183153002: NQE: Move ECT to net:: namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased, also fixed comnpilation error Created 4 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 side-by-side diff with in-line comments
Download patch
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
index 7f2fa9d23200319285398f55aa7f055bb6e0f397..e3f345d5b6ffa239dad17d9b841f84ac2b9ec625 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
@@ -280,7 +280,7 @@ DataReductionProxyConfig::DataReductionProxyConfig(
configurator_(configurator),
event_creator_(event_creator),
lofi_effective_connection_type_threshold_(
- net::NetworkQualityEstimator::EFFECTIVE_CONNECTION_TYPE_UNKNOWN),
+ net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN),
auto_lofi_hysteresis_(base::TimeDelta::Max()),
network_prohibitively_slow_(false),
connection_type_(net::NetworkChangeNotifier::GetConnectionType()),
@@ -456,13 +456,11 @@ bool DataReductionProxyConfig::IsNetworkQualityProhibitivelySlow(
network_type_changed = true;
}
- const net::NetworkQualityEstimator::EffectiveConnectionType
- effective_connection_type =
- network_quality_estimator->GetEffectiveConnectionType();
+ const net::EffectiveConnectionType effective_connection_type =
+ network_quality_estimator->GetEffectiveConnectionType();
const bool is_network_quality_available =
- effective_connection_type !=
- net::NetworkQualityEstimator::EFFECTIVE_CONNECTION_TYPE_UNKNOWN;
+ effective_connection_type != net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN;
// True only if the network is currently estimated to be slower than the
// defined thresholds.
@@ -512,9 +510,9 @@ void DataReductionProxyConfig::PopulateAutoLoFiParams() {
std::string field_trial = params::GetLoFiFieldTrialName();
// Default parameters to use.
- const net::NetworkQualityEstimator::EffectiveConnectionType
+ const net::EffectiveConnectionType
default_effective_connection_type_threshold =
- net::NetworkQualityEstimator::EFFECTIVE_CONNECTION_TYPE_SLOW_2G;
+ net::EFFECTIVE_CONNECTION_TYPE_SLOW_2G;
const base::TimeDelta default_hysterisis = base::TimeDelta::FromSeconds(60);
if (params::IsLoFiSlowConnectionsOnlyViaFlags()) {
@@ -794,12 +792,10 @@ void DataReductionProxyConfig::RecordAutoLoFiAccuracyRate(
if (now - last_query_ > 2 * measuring_duration)
return;
- const net::NetworkQualityEstimator::EffectiveConnectionType
- recent_effective_connection_type =
- network_quality_estimator->GetRecentEffectiveConnectionType(
- last_query_);
+ const net::EffectiveConnectionType recent_effective_connection_type =
+ network_quality_estimator->GetRecentEffectiveConnectionType(last_query_);
if (recent_effective_connection_type ==
- net::NetworkQualityEstimator::EFFECTIVE_CONNECTION_TYPE_UNKNOWN) {
+ net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN) {
return;
}
@@ -849,10 +845,8 @@ void DataReductionProxyConfig::RecordAutoLoFiAccuracyRate(
}
bool DataReductionProxyConfig::IsEffectiveConnectionTypeSlowerThanThreshold(
- net::NetworkQualityEstimator::EffectiveConnectionType
- effective_connection_type) const {
- return effective_connection_type >=
- net::NetworkQualityEstimator::EFFECTIVE_CONNECTION_TYPE_OFFLINE &&
+ net::EffectiveConnectionType effective_connection_type) const {
+ return effective_connection_type >= net::EFFECTIVE_CONNECTION_TYPE_OFFLINE &&
effective_connection_type <= lofi_effective_connection_type_threshold_;
}

Powered by Google App Engine
This is Rietveld 408576698