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

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: callback design (not yet done) 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 a67f77375b3da36855240b053f1a7b55cfbe0dc8..95409849b7628969169de6817a532f3b1450dcde 100644
--- a/chrome/browser/net/chrome_network_delegate.h
+++ b/chrome/browser/net/chrome_network_delegate.h
@@ -48,6 +48,7 @@ class InfoMap;
namespace net {
class URLRequest;
+class ProxyInfo;
}
namespace policy {
@@ -123,6 +124,16 @@ class ChromeNetworkDelegate : public net::NetworkDelegate {
data_reduction_proxy_params_ = params;
}
+ // 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();
@@ -159,6 +170,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;
@@ -250,6 +263,8 @@ class ChromeNetworkDelegate : public net::NetworkDelegate {
data_reduction_proxy::DataReductionProxyParams* data_reduction_proxy_params_;
+ OnResolveProxyHandler* on_resolve_proxy_handler_;
+
DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate);
};

Powered by Google App Engine
This is Rietveld 408576698