Chromium Code Reviews| 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..5bc1726f5e74214e4b41db07c9fffc0b557df674 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,19 @@ bool DataReductionProxyParams::IsIncludedInAndroidOnePromoFieldTrial( |
| return (fingerprint.find(kAndroidOneIdentifier) != std::string::npos); |
| } |
| +// static |
| +bool DataReductionProxyParams::IsIncludedInUseQUICFieldTrial() { |
| + return FieldTrialList::FindFullName("DataReductionProxyUseQuic") == kEnabled; |
| +} |
| + |
| +void DataReductionProxyParams::EnableQUIC(bool quic_enabled_for_proxies) { |
| + quic_enabled_for_proxies_ = quic_enabled_for_proxies; |
| + if (command_line_origin_.empty() && IsIncludedInUseQUICFieldTrial() && |
| + quic_enabled_for_proxies_) |
| + origin_ = net::ProxyServer::FromURI(kDefaultQuicOrigin, |
|
Ryan Hamilton
2015/02/11 00:20:32
It's a bit confusing that there's a member named "
tbansal1
2015/02/11 01:25:26
If other reviewers feel strongly about it, I volun
|
| + net::ProxyServer::SCHEME_HTTP); |
| +} |
| + |
| DataReductionProxyTypeInfo::DataReductionProxyTypeInfo() |
| : proxy_servers(), |
| is_fallback(false), |
| @@ -292,6 +306,7 @@ void DataReductionProxyParams::InitWithoutChecks() { |
| // command line. |
| if (origin.empty()) |
| origin = GetDefaultDevOrigin(); |
| + command_line_origin_ = origin; |
| if (origin.empty()) |
| origin = GetDefaultOrigin(); |
| if (fallback_origin.empty()) |
| @@ -520,7 +535,9 @@ bool DataReductionProxyParams::IsProxyBypassed( |
| // TODO(kundaji): Remove tests for macro definitions. |
| std::string DataReductionProxyParams::GetDefaultOrigin() const { |
| - return kDefaultOrigin; |
| + return IsIncludedInUseQUICFieldTrial() && quic_enabled_for_proxies_ |
| + ? kDefaultQuicOrigin |
| + : kDefaultSpdyOrigin; |
| } |
| std::string DataReductionProxyParams::GetDefaultFallbackOrigin() const { |