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, |