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

Side by Side Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.cc

Issue 2869863002: Enable QUIC for non core data saver proxies (Closed)
Patch Set: megjablon comments Created 3 years, 7 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 unified diff | Download patch
OLDNEW
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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 } 237 }
238 238
239 RecordGetDefaultAlternativeProxy(DEFAULT_ALTERNATIVE_PROXY_STATUS_AVAILABLE); 239 RecordGetDefaultAlternativeProxy(DEFAULT_ALTERNATIVE_PROXY_STATUS_AVAILABLE);
240 return proxy_server; 240 return proxy_server;
241 } 241 }
242 242
243 bool DataReductionProxyDelegate::SupportsQUIC( 243 bool DataReductionProxyDelegate::SupportsQUIC(
244 const net::ProxyServer& proxy_server) const { 244 const net::ProxyServer& proxy_server) const {
245 DCHECK(thread_checker_.CalledOnValidThread()); 245 DCHECK(thread_checker_.CalledOnValidThread());
246 // Enable QUIC for whitelisted proxies. 246 // Enable QUIC for whitelisted proxies.
247 // TODO(tbansal): Use client config service to control this whitelist. 247 return params::IsQuicForNonCoreProxiesEnabled() ||
megjablon 2017/05/10 23:11:24 suggestion: IsQuicEnabledForNonCoreProxies reads a
tbansal1 2017/05/11 01:29:28 Done.
248 return base::CommandLine::ForCurrentProcess()->HasSwitch(
249 switches::kDataReductionProxyEnableQuicOnNonCoreProxies) ||
250 proxy_server == 248 proxy_server ==
251 net::ProxyServer(net::ProxyServer::SCHEME_HTTPS, 249 net::ProxyServer(net::ProxyServer::SCHEME_HTTPS,
252 net::HostPortPair(kDataReductionCoreProxy, 443)); 250 net::HostPortPair(kDataReductionCoreProxy, 443));
253 } 251 }
254 252
255 void DataReductionProxyDelegate::RecordQuicProxyStatus( 253 void DataReductionProxyDelegate::RecordQuicProxyStatus(
256 QuicProxyStatus status) const { 254 QuicProxyStatus status) const {
257 DCHECK(thread_checker_.CalledOnValidThread()); 255 DCHECK(thread_checker_.CalledOnValidThread());
258 UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.Quic.ProxyStatus", status, 256 UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.Quic.ProxyStatus", status,
259 QUIC_PROXY_STATUS_BOUNDARY); 257 QUIC_PROXY_STATUS_BOUNDARY);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 if (data_reduction_proxy_config.enabled_by_user_and_reachable() && 306 if (data_reduction_proxy_config.enabled_by_user_and_reachable() &&
309 url.SchemeIs(url::kHttpScheme) && !net::IsLocalhost(url.host_piece()) && 307 url.SchemeIs(url::kHttpScheme) && !net::IsLocalhost(url.host_piece()) &&
310 !params::IsIncludedInHoldbackFieldTrial()) { 308 !params::IsIncludedInHoldbackFieldTrial()) {
311 UMA_HISTOGRAM_BOOLEAN( 309 UMA_HISTOGRAM_BOOLEAN(
312 "DataReductionProxy.ConfigService.HTTPRequests", 310 "DataReductionProxy.ConfigService.HTTPRequests",
313 !data_reduction_proxy_config.GetProxiesForHttp().empty()); 311 !data_reduction_proxy_config.GetProxiesForHttp().empty());
314 } 312 }
315 } 313 }
316 314
317 } // namespace data_reduction_proxy 315 } // namespace data_reduction_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698