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 4f0ca9a060c10bd51ab4567e1bbf06e50d52d701..2cea5918515e5157dd1f21fe177595285e0525c4 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 |
@@ -30,7 +30,8 @@ using base::FieldTrialList; |
namespace { |
const char kEnabled[] = "Enabled"; |
-const char kDefaultOrigin[] = "https://proxy.googlezip.net:443"; |
+const char kDefaultSpdyOrigin[] = "https://proxy.googlezip.net:443"; |
+const char kDefaultQuicOrigin[] = "quic://proxy.googlezip.net:443"; |
const char kDevOrigin[] = "https://proxy-dev.googlezip.net:443"; |
const char kDevFallbackOrigin[] = "proxy-dev.googlezip.net:80"; |
const char kDefaultFallbackOrigin[] = "compress.googlezip.net:80"; |
@@ -98,6 +99,12 @@ bool DataReductionProxyParams::IsIncludedInAndroidOnePromoFieldTrial( |
return (fingerprint.find(kAndroidOneIdentifier) != std::string::npos); |
} |
+// static |
+bool DataReductionProxyParams::IsIncludedInUseQUICAsPrimaryOriginFieldTrial() { |
+ return FieldTrialList::FindFullName( |
+ "DataReductionProxyUseQUICAsPrimaryOrigin") == kEnabled; |
Ryan Hamilton
2015/02/08 16:56:36
Hm. It's unfortunate that this file is duplicating
tbansal1
2015/02/10 19:46:04
Done.
|
+} |
+ |
DataReductionProxyTypeInfo::DataReductionProxyTypeInfo() |
: proxy_servers(), |
is_fallback(false), |
@@ -274,6 +281,7 @@ void DataReductionProxyParams::InitWithoutChecks() { |
!(origin.empty() && fallback_origin.empty() && ssl_origin.empty() && |
alt_origin.empty() && alt_fallback_origin.empty()); |
+ quic_globally_disabled_ = command_line.HasSwitch("disable-quic"); |
// Configuring the proxy on the command line overrides the values of |
// |allowed_| and |alt_allowed_|. |
@@ -520,7 +528,8 @@ bool DataReductionProxyParams::IsProxyBypassed( |
// TODO(kundaji): Remove tests for macro definitions. |
std::string DataReductionProxyParams::GetDefaultOrigin() const { |
- return kDefaultOrigin; |
+ return IsIncludedInUseQUICAsPrimaryOriginFieldTrial() && |
+ !quic_globally_disabled_ ? kDefaultQuicOrigin: kDefaultSpdyOrigin; |
} |
std::string DataReductionProxyParams::GetDefaultFallbackOrigin() const { |