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

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

Issue 2326443004: Fixing redirect through DataReductionProxy logic. (Closed)
Patch Set: tbansal comments Created 4 years, 3 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 a6fa327ebc7a8fa126a65d6f6b510fd9283df16d..d955ef42b4a00bf9f273a51dc55bc50ab6129b86 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
@@ -229,20 +229,24 @@ void DataReductionProxyNetworkDelegate::OnBeforeURLRequestInternal(
}
}
void DataReductionProxyNetworkDelegate::OnBeforeSendHeadersInternal(
net::URLRequest* request,
const net::ProxyInfo& proxy_info,
const net::ProxyRetryInfoMap& proxy_retry_info,
net::HttpRequestHeaders* headers) {
DCHECK(data_reduction_proxy_config_);
DCHECK(request);
+
+ // If this is after a redirect, reset |request|'s DataReductionProxyData.
+ DataReductionProxyData::ClearData(request);
+
if (params::IsIncludedInHoldbackFieldTrial()) {
if (!WasEligibleWithoutHoldback(*request, proxy_info, proxy_retry_info))
return;
// For the holdback field trial, still log UMA as if the proxy was used.
DataReductionProxyData* data =
DataReductionProxyData::GetDataAndCreateIfNecessary(request);
if (data)
data->set_used_data_reduction_proxy(true);
return;
}
@@ -258,21 +262,21 @@ void DataReductionProxyNetworkDelegate::OnBeforeSendHeadersInternal(
}
// Retrieves DataReductionProxyData from a request, creating a new instance
// if needed.
DataReductionProxyData* data =
DataReductionProxyData::GetDataAndCreateIfNecessary(request);
if (data) {
data->set_used_data_reduction_proxy(true);
data->set_session_key(
data_reduction_proxy_request_options_->GetSecureSession());
- data->set_original_request_url(request->original_url());
+ data->set_request_url(request->url());
if ((request->load_flags() & net::LOAD_MAIN_FRAME_DEPRECATED) &&
request->context()->network_quality_estimator()) {
data->set_effective_connection_type(request->context()
->network_quality_estimator()
->GetEffectiveConnectionType());
}
}
if (data_reduction_proxy_io_data_ &&
data_reduction_proxy_io_data_->lofi_decider()) {

Powered by Google App Engine
This is Rietveld 408576698