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

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

Issue 1933653004: Reset the Lo-Fi main frame state when there is a new main frame request (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 4 years, 7 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_request_options.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc
index e1305c4a6f6907b883468218e68b137cf3038a03..764769ab35576be3e802734e4dcfe7ad1f3596b4 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc
@@ -177,37 +177,21 @@ void DataReductionProxyRequestOptions::RandBytes(void* output,
crypto::RandBytes(output, length);
}
-void DataReductionProxyRequestOptions::MaybeAddRequestHeader(
- const net::ProxyServer& proxy_server,
+void DataReductionProxyRequestOptions::AddRequestHeader(
net::HttpRequestHeaders* request_headers) {
- DCHECK(thread_checker_.CalledOnValidThread());
- if (!proxy_server.is_valid())
- return;
- if (proxy_server.is_direct())
- return;
- if (proxy_server.host_port_pair().IsEmpty())
- return;
- if (data_reduction_proxy_config_->IsDataReductionProxy(
- proxy_server.host_port_pair(), NULL)) {
- SetHeader(request_headers);
- }
-}
-
-void DataReductionProxyRequestOptions::SetHeader(
- net::HttpRequestHeaders* headers) {
base::Time now = Now();
// Authorization credentials must be regenerated if they are expired.
if (!use_assigned_credentials_ && (now > credentials_expiration_time_))
UpdateCredentials();
const char kChromeProxyHeader[] = "Chrome-Proxy";
std::string header_value;
- if (headers->HasHeader(kChromeProxyHeader)) {
- headers->GetHeader(kChromeProxyHeader, &header_value);
- headers->RemoveHeader(kChromeProxyHeader);
+ if (request_headers->HasHeader(kChromeProxyHeader)) {
+ request_headers->GetHeader(kChromeProxyHeader, &header_value);
+ request_headers->RemoveHeader(kChromeProxyHeader);
header_value += ", ";
}
header_value += header_value_;
- headers->SetHeader(kChromeProxyHeader, header_value);
+ request_headers->SetHeader(kChromeProxyHeader, header_value);
}
void DataReductionProxyRequestOptions::ComputeCredentials(

Powered by Google App Engine
This is Rietveld 408576698