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

Unified Diff: chrome/browser/net/chrome_network_delegate.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: errata 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: 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 2f1af206b750d6ed4603818ed0bc3db11bef99be..6558ae123a8d01eac386242f1b1d44222e8e392a 100644
--- a/chrome/browser/net/chrome_network_delegate.cc
+++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -31,6 +31,7 @@
#include "chrome/browser/task_manager/task_manager.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
+#include "components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h"
#include "components/data_reduction_proxy/browser/data_reduction_proxy_metrics.h"
#include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h"
#include "components/data_reduction_proxy/browser/data_reduction_proxy_protocol.h"
@@ -49,6 +50,8 @@
#include "net/cookies/cookie_options.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
+#include "net/proxy/proxy_info.h"
+#include "net/proxy/proxy_server.h"
#include "net/socket_stream/socket_stream.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_context.h"
@@ -298,7 +301,8 @@ ChromeNetworkDelegate::ChromeNetworkDelegate(
first_request_(true),
prerender_tracker_(NULL),
data_reduction_proxy_params_(NULL),
- data_reduction_proxy_usage_stats_(NULL) {
+ data_reduction_proxy_usage_stats_(NULL),
+ data_reduction_proxy_auth_request_handler_(NULL) {
DCHECK(enable_referrers);
extensions_delegate_.reset(
ChromeExtensionsNetworkDelegate::Create(event_router));
@@ -478,6 +482,16 @@ int ChromeNetworkDelegate::OnBeforeSendHeaders(
return extensions_delegate_->OnBeforeSendHeaders(request, callback, headers);
}
+void ChromeNetworkDelegate::OnBeforeSendProxyHeaders(
+ net::URLRequest* request,
+ const net::ProxyInfo& proxy_info,
+ net::HttpRequestHeaders* headers) {
+ if (data_reduction_proxy_auth_request_handler_) {
+ data_reduction_proxy_auth_request_handler_->MaybeAddRequestHeader(
+ request, proxy_info.proxy_server(), headers);
+ }
+}
+
void ChromeNetworkDelegate::OnSendHeaders(
net::URLRequest* request,
const net::HttpRequestHeaders& headers) {
« no previous file with comments | « chrome/browser/net/chrome_network_delegate.h ('k') | chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698