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

Unified Diff: chrome/browser/io_thread.cc

Issue 2850003002: Add flag to override Effective Connection Type (Closed)
Patch Set: Rebased Created 3 years, 7 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
« no previous file with comments | « chrome/browser/flag_descriptions.cc ('k') | chrome/browser/io_thread_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/io_thread.cc
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 71de15ce54942b89a13064774c88853ebfb1a360..323c10372667b993f5e1058850a2357cf5c227f8 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -91,6 +91,7 @@
#include "net/net_features.h"
#include "net/nqe/external_estimate_provider.h"
#include "net/nqe/network_quality_estimator.h"
+#include "net/nqe/network_quality_estimator_params.h"
#include "net/proxy/proxy_config_service.h"
#include "net/proxy/proxy_script_fetcher_impl.h"
#include "net/proxy/proxy_service.h"
@@ -560,6 +561,19 @@ void IOThread::Init() {
variations::GetVariationParams(kNetworkQualityEstimatorFieldTrialName,
&network_quality_estimator_params);
+ if (command_line.HasSwitch(switches::kForceEffectiveConnectionType)) {
+ const std::string force_ect_value =
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kForceEffectiveConnectionType);
+
+ if (!force_ect_value.empty()) {
+ // If the effective connection type is forced using command line switch,
+ // it overrides the one set by field trial.
+ network_quality_estimator_params[net::kForceEffectiveConnectionType] =
+ force_ect_value;
+ }
+ }
+
std::unique_ptr<net::ExternalEstimateProvider> external_estimate_provider;
#if defined(OS_ANDROID)
external_estimate_provider.reset(
« no previous file with comments | « chrome/browser/flag_descriptions.cc ('k') | chrome/browser/io_thread_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698