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

Unified Diff: chrome/browser/net/chrome_network_delegate.cc

Issue 390533003: Bypassed Bytes UMAs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moving #if defined(SPDY_PROXY_AUTH_ORIGIN) Created 6 years, 5 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: chrome/browser/net/chrome_network_delegate.cc
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc
index a7d81e5a9cece514d0f14bc5e25364972e4ec9ad..925777412f30befdb66d66636bfc598df5ebf3f6 100644
--- a/chrome/browser/net/chrome_network_delegate.cc
+++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -298,6 +298,7 @@ ChromeNetworkDelegate::ChromeNetworkDelegate(
enable_referrers_(enable_referrers),
enable_do_not_track_(NULL),
force_google_safe_search_(NULL),
+ data_reduction_proxy_enabled_(NULL),
#if defined(ENABLE_CONFIGURATION_POLICY)
url_blacklist_manager_(NULL),
#endif
@@ -520,11 +521,15 @@ int ChromeNetworkDelegate::OnHeadersReceived(
const net::HttpResponseHeaders* original_response_headers,
scoped_refptr<net::HttpResponseHeaders>* override_response_headers,
GURL* allowed_unsafe_redirect_url) {
+ net::ProxyService::DataReductionProxyBypassType bypass_type;
if (data_reduction_proxy::MaybeBypassProxyAndPrepareToRetry(
data_reduction_proxy_params_,
request,
original_response_headers,
- override_response_headers)) {
+ override_response_headers,
+ &bypass_type)) {
+ if (data_reduction_proxy_usage_stats_)
+ data_reduction_proxy_usage_stats_->SetBypassType(bypass_type);
return net::OK;
}
@@ -614,6 +619,10 @@ void ChromeNetworkDelegate::OnCompleted(net::URLRequest* request,
RecordContentLengthHistograms(received_content_length,
original_content_length,
freshness_lifetime);
+ if (data_reduction_proxy_enabled_ && data_reduction_proxy_usage_stats_) {
+ data_reduction_proxy_usage_stats_->RecordBypassedBytesHistograms(
+ *request, *data_reduction_proxy_enabled_);
+ }
DVLOG(2) << __FUNCTION__
<< " received content length: " << received_content_length
<< " original content length: " << original_content_length

Powered by Google App Engine
This is Rietveld 408576698