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

Unified Diff: components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc

Issue 1839783002: Revert of Enable DRP config service by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/common/data_reduction_proxy_params.cc
diff --git a/components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc b/components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc
index eaf326aa6c1449e86fb81e16a2dd378dee1f022b..05ee6890c7de2a9bbe32f348351d2ff02391bf13 100644
--- a/components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc
+++ b/components/data_reduction_proxy/core/common/data_reduction_proxy_params.cc
@@ -47,6 +47,9 @@
const char kLoFiFieldTrial[] = "DataCompressionProxyLoFi";
const char kLoFiFlagFieldTrial[] = "DataCompressionProxyLoFiFlag";
+const char kConfigServiceFieldTrial[] = "DataReductionProxyConfigService";
+const char kConfigServiceURLParam[] = "url";
+
const char kTrustedSpdyProxyFieldTrialName[] = "DataReductionTrustedSpdyProxy";
// Default URL for retrieving the Data Reduction Proxy configuration.
@@ -183,10 +186,18 @@
(FieldTrialList::FindFullName(kDevRolloutFieldTrial) == kEnabled);
}
+std::string GetClientConfigFieldTrialName() {
+ return kConfigServiceFieldTrial;
+}
+
bool IsConfigClientEnabled() {
- // TODO(tbansal): crbug.com/597768 Remove the data reduction proxy deprecated
- // code which was used when config client is not enabled.
- return true;
+ std::string group_value =
+ base::FieldTrialList::FindFullName(kConfigServiceFieldTrial);
+ base::StringPiece group = group_value;
+ return base::CommandLine::ForCurrentProcess()->HasSwitch(
+ data_reduction_proxy::switches::
+ kEnableDataReductionProxyConfigClient) ||
+ group.starts_with(kEnabled);
}
GURL GetConfigServiceURL() {
@@ -195,6 +206,11 @@
if (command_line->HasSwitch(switches::kDataReductionProxyConfigURL)) {
url = command_line->GetSwitchValueASCII(
switches::kDataReductionProxyConfigURL);
+ }
+
+ if (url.empty()) {
+ url = variations::GetVariationParamValue(kConfigServiceFieldTrial,
+ kConfigServiceURLParam);
}
if (url.empty())

Powered by Google App Engine
This is Rietveld 408576698