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 d1aac75d2d2a2bbc6c1d8c02402b639bddc68d57..f00b56e35175bd08265aeeed3f57393a3e42dc89 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 |
@@ -118,13 +118,38 @@ DataReductionProxyUsageStats::~DataReductionProxyUsageStats() { |
}; |
void DataReductionProxyUsageStats::OnUrlRequestCompleted( |
- const net::URLRequest* request, bool started) { |
+ const net::URLRequest* request, bool started, bool is_main_frame) { |
DCHECK(thread_checker_.CalledOnValidThread()); |
- if (request->status().status() == net::URLRequestStatus::SUCCESS && |
- data_reduction_proxy_params_->WasDataReductionProxyUsed(request, NULL)) { |
- successful_requests_through_proxy_count_++; |
- NotifyUnavailabilityIfChanged(); |
+ DataReductionProxyTypeInfo proxy_info; |
+ if (data_reduction_proxy_params_->WasDataReductionProxyUsed(request, |
+ &proxy_info)) { |
+ if (request->status().status() == net::URLRequestStatus::SUCCESS) { |
+ successful_requests_through_proxy_count_++; |
+ NotifyUnavailabilityIfChanged(); |
+ } |
+ |
+ // Report any network errors that occurred for this request, including OK |
+ // and ABORTED. |
+ if (!proxy_info.is_fallback) { |
+ UMA_HISTOGRAM_SPARSE_SLOWLY( |
+ "DataReductionProxy.RequestCompletionErrorCodes.Primary", |
+ std::abs(request->status().error())); |
+ if (is_main_frame) { |
+ UMA_HISTOGRAM_SPARSE_SLOWLY( |
+ "DataReductionProxy.RequestCompletionErrorCodes.MainFrame.Primary", |
+ std::abs(request->status().error())); |
+ } |
+ } else { |
+ UMA_HISTOGRAM_SPARSE_SLOWLY( |
+ "DataReductionProxy.RequestCompletionErrorCodes.Fallback", |
+ std::abs(request->status().error())); |
+ if (is_main_frame) { |
+ UMA_HISTOGRAM_SPARSE_SLOWLY( |
+ "DataReductionProxy.RequestCompletionErrorCodes.MainFrame.Fallback", |
+ std::abs(request->status().error())); |
+ } |
+ } |
} |
} |