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

Unified Diff: chrome/browser/about_flags.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 | « no previous file | chrome/browser/flag_descriptions.h » ('j') | no next file with comments »
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 0fd1b2383050750f22955e9869957166f861f770..2ec43412083deb08707536d2dcfa0929457a54d4 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"
@@ -715,6 +716,36 @@ 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
+// Estimator (NQE) are also exposed via flags.
+static_assert(net::EFFECTIVE_CONNECTION_TYPE_LAST + 1 ==
+ arraysize(kForceEffectiveConnectionTypeChoices),
+ "ECT enum value is not handled.");
+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}};
@@ -2782,6 +2813,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)},
+
{"enable-heap-profiling", flag_descriptions::kEnableHeapProfilingName,
flag_descriptions::kEnableHeapProfilingDescription, kOsAll,
MULTI_VALUE_TYPE(kEnableHeapProfilingChoices)},
« no previous file with comments | « no previous file | chrome/browser/flag_descriptions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698