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

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

Issue 848103002: AreDataReductionProxiesBypassed should use the DRP config (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc
index 9ef087b0ced722e1a3e74496f1086a6f95932406..703b22c41d7a95b4696a395f7cdfcd0a18d91d9d 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc
@@ -195,9 +195,10 @@ void DataReductionProxyNetworkDelegate::OnCompletedInternal(
// or missing, as is the case with chunked encoding.
int64 received_content_length = request->received_response_content_length();
- if (!request->was_cached() && // Don't record cached content
- received_content_length && // Zero-byte responses aren't useful.
- (is_http || is_https)) { // Only record for HTTP or HTTPS urls.
+ if (!request->was_cached() && // Don't record cached content
+ received_content_length && // Zero-byte responses aren't useful.
+ (is_http || is_https) && // Only record for HTTP or HTTPS urls.
+ !proxy_config_getter_.is_null()) { // Used by request type and histograms.
int64 original_content_length =
request->response_info().headers->GetInt64HeaderValue(
"x-original-content-length");
@@ -206,6 +207,7 @@ void DataReductionProxyNetworkDelegate::OnCompletedInternal(
request->response_info().response_time).freshness;
DataReductionProxyRequestType request_type =
GetDataReductionProxyRequestType(*request,
+ proxy_config_getter_.Run(),
*data_reduction_proxy_params_);
int64 adjusted_original_content_length =
@@ -220,8 +222,7 @@ void DataReductionProxyNetworkDelegate::OnCompletedInternal(
freshness_lifetime);
if (data_reduction_proxy_enabled_ &&
- data_reduction_proxy_usage_stats_ &&
- !proxy_config_getter_.is_null()) {
+ data_reduction_proxy_usage_stats_) {
data_reduction_proxy_usage_stats_->RecordBytesHistograms(
*request,
*data_reduction_proxy_enabled_,

Powered by Google App Engine
This is Rietveld 408576698