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

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

Issue 863203009: Store Proxy Servers as proxy servers and not GURLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed failing test code. Created 5 years, 10 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_usage_stats.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_usage_stats.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_usage_stats.cc
index 7c1293b431570c4b1d4ebe4b7afbfd7008c57c29..e2d40b57d4372b1691094d6aa3b32e33573de849 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_usage_stats.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_usage_stats.cc
@@ -249,11 +249,12 @@ void DataReductionProxyUsageStats::RecordBypassedBytesHistograms(
content_length);
// If non-empty, |proxy_server.first| is the proxy that this request used.
- if (!data_reduction_proxy_type_info.proxy_servers.first.is_empty()) {
+ const net::ProxyServer& first =
+ data_reduction_proxy_type_info.proxy_servers.first;
+ if (first.is_valid() && !first.host_port_pair().IsEmpty()) {
DataReductionProxyTamperDetection::DetectAndReport(
request.response_info().headers.get(),
- data_reduction_proxy_type_info.proxy_servers.first.SchemeIsSecure(),
- content_length);
+ first.is_https() || first.is_quic(), content_length);
}
return;
}
@@ -268,7 +269,7 @@ void DataReductionProxyUsageStats::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_empty());
+ DCHECK(!data_reduction_proxy_type_info.proxy_servers.first.is_valid());
if (!request.proxy_server().IsEmpty()) {
RecordBypassedBytes(last_bypass_type_,
DataReductionProxyUsageStats::PROXY_OVERRIDDEN,

Powered by Google App Engine
This is Rietveld 408576698