OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_dele
gate.h" | 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_dele
gate.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 // broken too. | 214 // broken too. |
215 alternative_proxies_broken_ = true; | 215 alternative_proxies_broken_ = true; |
216 UMA_HISTOGRAM_COUNTS_100("DataReductionProxy.Quic.OnAlternativeProxyBroken", | 216 UMA_HISTOGRAM_COUNTS_100("DataReductionProxy.Quic.OnAlternativeProxyBroken", |
217 1); | 217 1); |
218 } | 218 } |
219 | 219 |
220 bool DataReductionProxyDelegate::SupportsQUIC( | 220 bool DataReductionProxyDelegate::SupportsQUIC( |
221 const net::ProxyServer& proxy_server) const { | 221 const net::ProxyServer& proxy_server) const { |
222 DCHECK(thread_checker_.CalledOnValidThread()); | 222 DCHECK(thread_checker_.CalledOnValidThread()); |
223 // Enable QUIC for whitelisted proxies. | 223 // Enable QUIC for whitelisted proxies. |
224 // TODO(tbansal): Use client config service to control this whitelist. | 224 return params::IsQuicEnabledForNonCoreProxies() || |
225 return base::CommandLine::ForCurrentProcess()->HasSwitch( | |
226 switches::kDataReductionProxyEnableQuicOnNonCoreProxies) || | |
227 proxy_server == | 225 proxy_server == |
228 net::ProxyServer(net::ProxyServer::SCHEME_HTTPS, | 226 net::ProxyServer(net::ProxyServer::SCHEME_HTTPS, |
229 net::HostPortPair(kDataReductionCoreProxy, 443)); | 227 net::HostPortPair(kDataReductionCoreProxy, 443)); |
230 } | 228 } |
231 | 229 |
232 void DataReductionProxyDelegate::RecordQuicProxyStatus( | 230 void DataReductionProxyDelegate::RecordQuicProxyStatus( |
233 QuicProxyStatus status) const { | 231 QuicProxyStatus status) const { |
234 DCHECK(thread_checker_.CalledOnValidThread()); | 232 DCHECK(thread_checker_.CalledOnValidThread()); |
235 UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.Quic.ProxyStatus", status, | 233 UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.Quic.ProxyStatus", status, |
236 QUIC_PROXY_STATUS_BOUNDARY); | 234 QUIC_PROXY_STATUS_BOUNDARY); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 if (data_reduction_proxy_config.enabled_by_user_and_reachable() && | 276 if (data_reduction_proxy_config.enabled_by_user_and_reachable() && |
279 url.SchemeIs(url::kHttpScheme) && !net::IsLocalhost(url.host_piece()) && | 277 url.SchemeIs(url::kHttpScheme) && !net::IsLocalhost(url.host_piece()) && |
280 !params::IsIncludedInHoldbackFieldTrial()) { | 278 !params::IsIncludedInHoldbackFieldTrial()) { |
281 UMA_HISTOGRAM_BOOLEAN( | 279 UMA_HISTOGRAM_BOOLEAN( |
282 "DataReductionProxy.ConfigService.HTTPRequests", | 280 "DataReductionProxy.ConfigService.HTTPRequests", |
283 !data_reduction_proxy_config.GetProxiesForHttp().empty()); | 281 !data_reduction_proxy_config.GetProxiesForHttp().empty()); |
284 } | 282 } |
285 } | 283 } |
286 | 284 |
287 } // namespace data_reduction_proxy | 285 } // namespace data_reduction_proxy |
OLD | NEW |