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

Unified Diff: net/nqe/network_quality_estimator_params.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 | « net/nqe/network_quality_estimator_params.h ('k') | net/nqe/network_quality_estimator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/nqe/network_quality_estimator_params.cc
diff --git a/net/nqe/network_quality_estimator_params.cc b/net/nqe/network_quality_estimator_params.cc
index 4da0ea209bee322248d7cc84acda049523853e8d..56ab6298f96ad81980119cc3bbd28e0dfa121501 100644
--- a/net/nqe/network_quality_estimator_params.cc
+++ b/net/nqe/network_quality_estimator_params.cc
@@ -79,27 +79,6 @@ double GetWeightMultiplierPerSecond(
return pow(0.5, 1.0 / half_life_seconds);
}
-base::Optional<net::EffectiveConnectionType> GetForcedEffectiveConnectionType(
- const std::map<std::string, std::string>& params) {
- std::string forced_value = GetStringValueForVariationParamWithDefaultValue(
- params, "force_effective_connection_type", "");
- if (forced_value.empty())
- return base::Optional<net::EffectiveConnectionType>();
-
- net::EffectiveConnectionType forced_effective_connection_type =
- net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN;
-
- bool effective_connection_type_available = GetEffectiveConnectionTypeForName(
- forced_value, &forced_effective_connection_type);
-
- DCHECK(effective_connection_type_available);
-
- // Silence unused variable warning in release builds.
- (void)effective_connection_type_available;
-
- return forced_effective_connection_type;
-}
-
bool GetPersistentCacheReadingEnabled(
const std::map<std::string, std::string>& params) {
if (GetStringValueForVariationParamWithDefaultValue(
@@ -120,6 +99,33 @@ base::TimeDelta GetMinSocketWatcherNotificationInterval(
namespace net {
+const char kForceEffectiveConnectionType[] = "force_effective_connection_type";
+
+namespace {
+
+base::Optional<EffectiveConnectionType> GetForcedEffectiveConnectionType(
+ const std::map<std::string, std::string>& params) {
+ std::string forced_value = GetStringValueForVariationParamWithDefaultValue(
+ params, kForceEffectiveConnectionType, "");
+ if (forced_value.empty())
+ return base::Optional<EffectiveConnectionType>();
+
+ EffectiveConnectionType forced_effective_connection_type =
+ EFFECTIVE_CONNECTION_TYPE_UNKNOWN;
+
+ bool effective_connection_type_available = GetEffectiveConnectionTypeForName(
+ forced_value, &forced_effective_connection_type);
+
+ DCHECK(effective_connection_type_available);
+
+ // Silence unused variable warning in release builds.
+ (void)effective_connection_type_available;
+
+ return forced_effective_connection_type;
+}
+
+} // namespace
+
namespace nqe {
namespace internal {
« no previous file with comments | « net/nqe/network_quality_estimator_params.h ('k') | net/nqe/network_quality_estimator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698