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

Unified Diff: chrome/browser/about_flags.cc

Issue 2850003002: Add flag to override Effective Connection Type (Closed)
Patch Set: ps Created 3 years, 8 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 | « no previous file | chrome/browser/flag_descriptions.h » ('j') | chrome/browser/flag_descriptions.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/about_flags.cc
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index d9a048eea033df659f8cee2ab3ce9477fec9a181..f27782ff07edd9a09c28a82a28f1e54bc1bf10d1 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -85,6 +85,7 @@
#include "media/media_features.h"
#include "media/midi/midi_switches.h"
#include "net/cert/cert_verify_proc_android.h"
+#include "net/nqe/effective_connection_type.h"
#include "ppapi/features/features.h"
#include "printing/features/features.h"
#include "services/device/public/cpp/device_features.h"
@@ -721,6 +722,33 @@ const FeatureEntry::Choice kAutoplayPolicyChoices[] = {
#endif
};
+const FeatureEntry::Choice kForceEffectiveConnectionTypeChoices[] = {
+ {flags_ui::kGenericExperimentChoiceDefault, "", ""},
+ {flag_descriptions::kEffectiveConnectionTypeUnknownDescription,
+ switches::kForceEffectiveConnectionType,
+ net::kEffectiveConnectionTypeUnknown},
+ {flag_descriptions::kEffectiveConnectionTypeOfflineDescription,
+ switches::kForceEffectiveConnectionType,
+ net::kEffectiveConnectionTypeOffline},
+ {flag_descriptions::kEffectiveConnectionTypeSlow2GDescription,
+ switches::kForceEffectiveConnectionType,
+ net::kEffectiveConnectionTypeSlow2G},
+ {flag_descriptions::kEffectiveConnectionType2GDescription,
+ switches::kForceEffectiveConnectionType, net::kEffectiveConnectionType2G},
+ {flag_descriptions::kEffectiveConnectionType3GDescription,
+ switches::kForceEffectiveConnectionType, net::kEffectiveConnectionType3G},
+ {flag_descriptions::kEffectiveConnectionType4GDescription,
+ switches::kForceEffectiveConnectionType, net::kEffectiveConnectionType4G},
+};
+
+// Ensure that all effective connection types returned by Network Quality
RyanSturm 2017/05/01 23:08:34 Maybe add a static_assert to make sure kForceEffec
tbansal1 2017/05/02 00:01:50 Done.
+// Estimator (NQE) are also exposed via flags.
+static_assert(net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN == 0,
+ "ECT enum value is not handled.");
+static_assert(net::EFFECTIVE_CONNECTION_TYPE_4G + 1 ==
+ net::EFFECTIVE_CONNECTION_TYPE_LAST,
+ "ECT enum value is not handled.");
+
const FeatureEntry::FeatureParam kNoStatePrefetchEnabled[] = {
{prerender::kNoStatePrefetchFeatureModeParameterName,
prerender::kNoStatePrefetchFeatureModeParameterPrefetch}};
@@ -2765,6 +2793,11 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kAutoplayPolicyDescription, kOsAll,
MULTI_VALUE_TYPE(kAutoplayPolicyChoices)},
+ {"force-effective-connection-type",
+ flag_descriptions::kForceEffectiveConnectionTypeName,
+ flag_descriptions::kForceEffectiveConnectionTypeDescription, kOsAll,
+ MULTI_VALUE_TYPE(kForceEffectiveConnectionTypeChoices)},
+
// NOTE: Adding new command-line switches requires adding corresponding
// entries to enum "LoginCustomFlags" in histograms.xml. See note in
// histograms.xml and don't forget to run AboutFlagsHistogramTest unit test.
« no previous file with comments | « no previous file | chrome/browser/flag_descriptions.h » ('j') | chrome/browser/flag_descriptions.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698