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..f603265c23a4761c2cec4b2912786beec7731ce9 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 |
@@ -128,8 +128,13 @@ void DataReductionProxyUsageStats::OnUrlRequestCompleted( |
DCHECK(thread_checker_.CalledOnValidThread()); |
DataReductionProxyTypeInfo proxy_info; |
+ // Ignore requests that did not use the data reduction proxy. The check for |
+ // LOAD_BYPASS_PROXY is necessary because the proxy_server() in the |request| |
+ // might still be set to the data reduction proxy if |request| was retried |
+ // over direct and a network error occurred while retrying it. |
if (data_reduction_proxy_params_->WasDataReductionProxyUsed(request, |
- &proxy_info)) { |
+ &proxy_info) && |
+ (request->load_flags() & net::LOAD_BYPASS_PROXY) == 0) { |
if (request->status().status() == net::URLRequestStatus::SUCCESS) { |
successful_requests_through_proxy_count_++; |
NotifyUnavailabilityIfChanged(); |