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

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: 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 89bb50a277bb2a918abc0b815d27372a65bb312e..2c56557e0be9f2c6cd70d00a70aa6ec55754ac27 100644
--- a/chrome/browser/net/chrome_network_delegate.cc
+++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -48,6 +48,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"
@@ -68,6 +70,12 @@
#include "components/policy/core/browser/url_blacklist_manager.h"
#endif
+#if defined(OS_ANDROID)
mef 2014/06/24 17:41:56 Why is this included on Android only?
bengr 2014/06/24 19:01:50 Uggh. Rebase automerge. Done.
+#include "chrome/browser/io_thread.h"
+#include "components/precache/content/precache_manager.h"
+#include "components/precache/content/precache_manager_factory.h"
+#endif
+
using content::BrowserThread;
using content::RenderViewHost;
using content::ResourceRequestInfo;
@@ -476,6 +484,18 @@ int ChromeNetworkDelegate::OnBeforeSendHeaders(
return extensions_delegate_->OnBeforeSendHeaders(request, callback, headers);
}
+int ChromeNetworkDelegate::OnBeforeSendProxyHeaders(
+ net::URLRequest* request,
+ const net::ProxyInfo* proxy_info,
+ net::HttpRequestHeaders* headers) {
+ DCHECK(proxy_info);
+ if (data_reduction_proxy_auth_request_handler_) {
+ data_reduction_proxy_auth_request_handler_->MaybeAddRequestHeader(
mef 2014/06/24 17:41:56 Should there be some meaningful return here?
bengr 2014/06/24 19:01:50 I guess there could be. I wasn't sure about the re
bengr 2014/06/25 16:12:35 Changed to a void return.
+ request, proxy_info->proxy_server(), headers);
+ }
+ return net::OK;
+}
+
void ChromeNetworkDelegate::OnSendHeaders(
net::URLRequest* request,
const net::HttpRequestHeaders& headers) {

Powered by Google App Engine
This is Rietveld 408576698