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

Side by Side Diff: net/base/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: bengr's nit 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_BASE_NETWORK_DELEGATE_H_ 5 #ifndef NET_BASE_NETWORK_DELEGATE_H_
6 #define NET_BASE_NETWORK_DELEGATE_H_ 6 #define NET_BASE_NETWORK_DELEGATE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 virtual ~NetworkDelegate() {} 55 virtual ~NetworkDelegate() {}
56 56
57 // Notification interface called by the network stack. Note that these 57 // Notification interface called by the network stack. Note that these
58 // functions mostly forward to the private virtuals. They also add some sanity 58 // functions mostly forward to the private virtuals. They also add some sanity
59 // checking on parameters. See the corresponding virtuals for explanations of 59 // checking on parameters. See the corresponding virtuals for explanations of
60 // the methods and their arguments. 60 // the methods and their arguments.
61 int NotifyBeforeURLRequest(URLRequest* request, 61 int NotifyBeforeURLRequest(URLRequest* request,
62 const CompletionCallback& callback, 62 const CompletionCallback& callback,
63 GURL* new_url); 63 GURL* new_url);
64 void NotifyResolveProxy(const GURL& url, int load_flags,
65 ProxyInfo* result);
64 int NotifyBeforeSendHeaders(URLRequest* request, 66 int NotifyBeforeSendHeaders(URLRequest* request,
65 const CompletionCallback& callback, 67 const CompletionCallback& callback,
66 HttpRequestHeaders* headers); 68 HttpRequestHeaders* headers);
67 void NotifyBeforeSendProxyHeaders(URLRequest* request, 69 void NotifyBeforeSendProxyHeaders(URLRequest* request,
68 const ProxyInfo& proxy_info, 70 const ProxyInfo& proxy_info,
69 HttpRequestHeaders* headers); 71 HttpRequestHeaders* headers);
70 void NotifySendHeaders(URLRequest* request, 72 void NotifySendHeaders(URLRequest* request,
71 const HttpRequestHeaders& headers); 73 const HttpRequestHeaders& headers);
72 int NotifyHeadersReceived( 74 int NotifyHeadersReceived(
73 URLRequest* request, 75 URLRequest* request,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // called for this request. Returns a net status code, generally either OK to 116 // called for this request. Returns a net status code, generally either OK to
115 // continue with the request or ERR_IO_PENDING if the result is not ready yet. 117 // continue with the request or ERR_IO_PENDING if the result is not ready yet.
116 // A status code other than OK and ERR_IO_PENDING will cancel the request and 118 // A status code other than OK and ERR_IO_PENDING will cancel the request and
117 // report the status code as the reason. 119 // report the status code as the reason.
118 // 120 //
119 // The default implementation returns OK (continue with request). 121 // The default implementation returns OK (continue with request).
120 virtual int OnBeforeURLRequest(URLRequest* request, 122 virtual int OnBeforeURLRequest(URLRequest* request,
121 const CompletionCallback& callback, 123 const CompletionCallback& callback,
122 GURL* new_url); 124 GURL* new_url);
123 125
126 // Called as the proxy is being resolved for |url|. Allows the delegate to
127 // override the proxy resolution decision made by ProxyService. The delegate
128 // may override the decision by modifying the ProxyInfo |result|.
129 virtual void OnResolveProxy(const GURL& url,
130 int load_flags,
131 ProxyInfo* result);
132
124 // Called right before the HTTP headers are sent. Allows the delegate to 133 // Called right before the HTTP headers are sent. Allows the delegate to
125 // read/write |headers| before they get sent out. |callback| and |headers| are 134 // read/write |headers| before they get sent out. |callback| and |headers| are
126 // valid only until OnCompleted or OnURLRequestDestroyed is called for this 135 // valid only until OnCompleted or OnURLRequestDestroyed is called for this
127 // request. 136 // request.
128 // See OnBeforeURLRequest for return value description. Returns OK by default. 137 // See OnBeforeURLRequest for return value description. Returns OK by default.
129 virtual int OnBeforeSendHeaders(URLRequest* request, 138 virtual int OnBeforeSendHeaders(URLRequest* request,
130 const CompletionCallback& callback, 139 const CompletionCallback& callback,
131 HttpRequestHeaders* headers); 140 HttpRequestHeaders* headers);
132 141
133 // Called after a proxy connection. Allows the delegate to read/write 142 // Called after a proxy connection. Allows the delegate to read/write
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 254
246 // Called before a SocketStream tries to connect. 255 // Called before a SocketStream tries to connect.
247 // See OnBeforeURLRequest for return value description. Returns OK by default. 256 // See OnBeforeURLRequest for return value description. Returns OK by default.
248 virtual int OnBeforeSocketStreamConnect( 257 virtual int OnBeforeSocketStreamConnect(
249 SocketStream* socket, const CompletionCallback& callback); 258 SocketStream* socket, const CompletionCallback& callback);
250 }; 259 };
251 260
252 } // namespace net 261 } // namespace net
253 262
254 #endif // NET_BASE_NETWORK_DELEGATE_H_ 263 #endif // NET_BASE_NETWORK_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698