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

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

Issue 2426903003: Record Proxy Server scheme accurately (Closed)
Patch Set: addressed comments, moved various other tests from Mock framework Created 4 years, 2 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_bypass_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_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 01f0901e9bf8e0507e6b2405bab03215b550c199..a4cc7bdcb3b66b566a8661ffbb2352e7b100832f 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
@@ -150,27 +150,36 @@ void DataReductionProxyBypassStats::OnUrlRequestCompleted(
// 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_config_->WasDataReductionProxyUsed(request,
- &proxy_info) &&
- (request->load_flags() & net::LOAD_BYPASS_PROXY) == 0 &&
- net_error == net::OK) {
- successful_requests_through_proxy_count_++;
- NotifyUnavailabilityIfChanged();
-
- // Report the success counts.
+ if (!data_reduction_proxy_config_->WasDataReductionProxyUsed(request,
+ &proxy_info) ||
+ (request->load_flags() & net::LOAD_BYPASS_PROXY) != 0 ||
+ net_error != net::OK) {
+ return;
+ }
+ successful_requests_through_proxy_count_++;
+ NotifyUnavailabilityIfChanged();
+
+ // Report the success counts.
+ UMA_HISTOGRAM_COUNTS_100(
+ "DataReductionProxy.SuccessfulRequestCompletionCounts",
+ proxy_info.proxy_index);
+
+ DCHECK(request->proxy_server().host_port_pair().Equals(
+ proxy_info.proxy_servers.front().host_port_pair()));
+
+ // It is possible that the scheme of request->proxy_server() is different
+ // from the scheme of proxy_info.proxy_servers.front(). The former may be set
+ // to QUIC by the network stack, while the latter may be set to HTTPS.
+
+ UMA_HISTOGRAM_ENUMERATION(
+ "DataReductionProxy.ProxySchemeUsed",
+ ConvertNetProxySchemeToProxyScheme(request->proxy_server().scheme()),
+ PROXY_SCHEME_MAX);
+ if (request->load_flags() & net::LOAD_MAIN_FRAME_DEPRECATED) {
UMA_HISTOGRAM_COUNTS_100(
- "DataReductionProxy.SuccessfulRequestCompletionCounts",
+ "DataReductionProxy.SuccessfulRequestCompletionCounts.MainFrame",
proxy_info.proxy_index);
- UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.ProxySchemeUsed",
- ConvertNetProxySchemeToProxyScheme(
- proxy_info.proxy_servers[0].scheme()),
- PROXY_SCHEME_MAX);
- if (request->load_flags() & net::LOAD_MAIN_FRAME_DEPRECATED) {
- UMA_HISTOGRAM_COUNTS_100(
- "DataReductionProxy.SuccessfulRequestCompletionCounts.MainFrame",
- proxy_info.proxy_index);
}
- }
}
void DataReductionProxyBypassStats::SetBypassType(
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698