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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.cc

Issue 1124073008: Base Data Reduction Proxy configuration on vectors of servers per origin scheme. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bengr CR comments Created 5 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 side-by-side diff with in-line comments
Download patch
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.cc
index 1664cc1862a7728e07bba4959340181456c6ec08..76cc901b693bee3de70e34dc7117fdaa4e552464 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.cc
@@ -260,13 +260,16 @@ void DataReductionProxyBypassStats::RecordBypassedBytesHistograms(
DataReductionProxyBypassStats::NOT_BYPASSED,
content_length);
- // If non-empty, |proxy_server.first| is the proxy that this request used.
- const net::ProxyServer& first =
- data_reduction_proxy_type_info.proxy_servers.first;
- if (first.is_valid() && !first.host_port_pair().IsEmpty()) {
+ if (data_reduction_proxy_type_info.proxy_servers.empty())
+ return;
+
+ // Obtain the proxy that this request used.
+ const net::ProxyServer& proxy =
+ data_reduction_proxy_type_info.proxy_servers.front();
+ if (proxy.is_valid() && !proxy.host_port_pair().IsEmpty()) {
DataReductionProxyTamperDetection::DetectAndReport(
request.response_info().headers.get(),
- first.is_https() || first.is_quic(), content_length);
+ proxy.is_https() || proxy.is_quic(), content_length);
}
return;
}
@@ -281,7 +284,7 @@ void DataReductionProxyBypassStats::RecordBypassedBytesHistograms(
// Now that the data reduction proxy is a best effort proxy, if the effective
// proxy configuration resolves to anything other than direct:// for a URL,
// the data reduction proxy will not be used.
- DCHECK(!data_reduction_proxy_type_info.proxy_servers.first.is_valid());
+ DCHECK(data_reduction_proxy_type_info.proxy_servers.empty());
if (!request.proxy_server().IsEmpty()) {
RecordBypassedBytes(last_bypass_type_,
DataReductionProxyBypassStats::PROXY_OVERRIDDEN,

Powered by Google App Engine
This is Rietveld 408576698