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

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: somehow missed a chromeos ResolveProxy invocation Created 6 years, 5 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
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | chrome/browser/net/chrome_network_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f16c44351d912957b1d0a65c284a518038bf9e84 100644
--- a/chrome/browser/net/chrome_network_delegate.h
+++ b/chrome/browser/net/chrome_network_delegate.h
@@ -66,6 +66,15 @@ class PrerenderTracker;
// add hooks into the network stack.
class ChromeNetworkDelegate : public net::NetworkDelegate {
public:
+ // 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,
+ const data_reduction_proxy::DataReductionProxyParams* params,
+ net::ProxyInfo* result)> OnResolveProxyHandler;
+
// |enable_referrers| (and all of the other optional PrefMembers) should be
// initialized on the UI thread (see below) beforehand. This object's owner is
// responsible for cleaning them up at shutdown.
@@ -142,6 +151,10 @@ class ChromeNetworkDelegate : public net::NetworkDelegate {
data_reduction_proxy_auth_request_handler_ = handler;
}
+ 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 +191,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 +295,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);
};
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | chrome/browser/net/chrome_network_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698