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

Unified Diff: chrome/browser/net/chrome_network_delegate.h

Issue 332313003: Add Finch experiment for selectively bypassing proxies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2-line change: Add missing ifdef(SPDY_PROXY_AUTH_ORIGIN); previously only compiled on android, but … 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.h
diff --git a/chrome/browser/net/chrome_network_delegate.h b/chrome/browser/net/chrome_network_delegate.h
index 976e1bbbb5256eb10bef925dd50b8279cb3178d1..89501191b30be1f5e3a0575564c45c2fdba72445 100644
--- a/chrome/browser/net/chrome_network_delegate.h
+++ b/chrome/browser/net/chrome_network_delegate.h
@@ -52,6 +52,7 @@ class InfoMap;
namespace net {
class ProxyInfo;
class URLRequest;
+class ProxyInfo;
mmenke 2014/07/01 19:45:12 nit: Already forward declared.
rcs 2014/07/02 00:56:20 Done.
}
namespace policy {
@@ -142,6 +143,16 @@ class ChromeNetworkDelegate : public net::NetworkDelegate {
data_reduction_proxy_auth_request_handler_ = handler;
}
+ // Provides an opportunity to interpose on proxy resolution. Called before
+ // ProxyService.ResolveProxy() returns. |proxy_info| contains information
+ // about the proxy being used, and may be modified by this callback.
+ typedef base::Callback<void(const GURL& url, int load_flags,
+ net::ProxyInfo* result)> OnResolveProxyHandler;
+
+ void set_on_resolve_proxy_handler(OnResolveProxyHandler* handler) {
+ on_resolve_proxy_handler_ = handler;
+ }
+
// Adds the Client Hints header to HTTP requests.
void SetEnableClientHints();
@@ -178,6 +189,8 @@ class ChromeNetworkDelegate : public net::NetworkDelegate {
virtual int OnBeforeURLRequest(net::URLRequest* request,
const net::CompletionCallback& callback,
GURL* new_url) OVERRIDE;
+ virtual void OnResolveProxy(
+ const GURL& url, int load_flags, net::ProxyInfo* result) OVERRIDE;
virtual int OnBeforeSendHeaders(net::URLRequest* request,
const net::CompletionCallback& callback,
net::HttpRequestHeaders* headers) OVERRIDE;
@@ -280,6 +293,8 @@ class ChromeNetworkDelegate : public net::NetworkDelegate {
data_reduction_proxy::DataReductionProxyAuthRequestHandler*
data_reduction_proxy_auth_request_handler_;
+ OnResolveProxyHandler* on_resolve_proxy_handler_;
+
DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate);
};

Powered by Google App Engine
This is Rietveld 408576698