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

Unified Diff: net/url_request/url_request_http_job.cc

Issue 333113002: Move data reduction proxy to Chrome-Proxy header for authentication (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@flywheel-refactor-net-fake-a-redirect-response-headers-chrome-proxy-auth
Patch Set: Created 6 years, 6 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: net/url_request/url_request_http_job.cc
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index 4b7d4e0fae5a0f7290857d62c5237c44790b7e47..69312ab0a8eb28a090cdf2aa955abcc83150585a 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -34,6 +34,7 @@
#include "net/http/http_transaction.h"
#include "net/http/http_transaction_factory.h"
#include "net/http/http_util.h"
+#include "net/proxy/proxy_info.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "net/ssl/ssl_config_service.h"
#include "net/url_request/fraudulent_certificate_reporter.h"
@@ -286,6 +287,17 @@ void URLRequestHttpJob::Kill() {
URLRequestJob::Kill();
}
+void URLRequestHttpJob::NotifyBeforeSendProxyHeadersCallback(
+ const ProxyInfo& proxy_info) {
+ DCHECK_NE(URLRequestStatus::CANCELED, GetStatus().status());
+ if (network_delegate()) {
+ network_delegate()->NotifyBeforeSendProxyHeaders(
+ request_,
+ proxy_info,
+ &request_info_.extra_headers);
+ }
+}
+
void URLRequestHttpJob::NotifyHeadersComplete() {
DCHECK(!response_info_);
@@ -430,6 +442,9 @@ void URLRequestHttpJob::StartTransactionInternal() {
transaction_->SetBeforeNetworkStartCallback(
base::Bind(&URLRequestHttpJob::NotifyBeforeNetworkStart,
base::Unretained(this)));
+ transaction_->SetBeforeProxyHeadersSentCallback(
+ base::Bind(&URLRequestHttpJob::NotifyBeforeSendProxyHeadersCallback,
+ base::Unretained(this)));
if (!throttling_entry_.get() ||
!throttling_entry_->ShouldRejectRequest(*request_)) {

Powered by Google App Engine
This is Rietveld 408576698