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

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

Issue 896793004: Don't report DRP request error code UMA when LOAD_BYPASS_PROXY is set. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_usage_stats_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_usage_stats_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698