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

Unified Diff: components/data_reduction_proxy/browser/data_reduction_proxy_params.cc

Issue 549153003: Dev finch trial of the data reduction proxy overrides both the primary and the fallback hosts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments. Created 6 years, 3 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/browser/data_reduction_proxy_params.cc
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_params.cc b/components/data_reduction_proxy/browser/data_reduction_proxy_params.cc
index 3088e083eabe41bbfde98532a6d12f9ec78fc1fd..43d0795a573ce019e49491ef52d8bcc3a916862d 100644
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_params.cc
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_params.cc
@@ -253,6 +253,8 @@ void DataReductionProxyParams::InitWithoutChecks() {
if (origin.empty())
origin = GetDefaultOrigin();
if (fallback_origin.empty())
+ fallback_origin = GetDefaultDevFallbackOrigin();
+ if (fallback_origin.empty())
fallback_origin = GetDefaultFallbackOrigin();
if (ssl_origin.empty())
ssl_origin = GetDefaultSSLOrigin();
@@ -396,6 +398,20 @@ std::string DataReductionProxyParams::GetDefaultDevOrigin() const {
return std::string();
}
+std::string DataReductionProxyParams::GetDefaultDevFallbackOrigin() const {
+#if defined(DATA_REDUCTION_DEV_FALLBACK_HOST)
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ if (command_line.HasSwitch(switches::kDisableDataReductionProxyDev))
+ return std::string();
+ if (command_line.HasSwitch(switches::kEnableDataReductionProxyDev) ||
+ (FieldTrialList::FindFullName("DataCompressionProxyDevRollout") ==
+ kEnabled)) {
+ return DATA_REDUCTION_DEV_FALLBACK_HOST;
+ }
+#endif
+ return std::string();
+}
+
bool DataReductionProxyParams::AreDataReductionProxiesBypassed(
const net::URLRequest& request, base::TimeDelta* min_retry_delay) const {
if (request.context() != NULL &&

Powered by Google App Engine
This is Rietveld 408576698