OLD | NEW |
---|---|
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 // checking on parameters. See the corresponding virtuals for explanations of | 61 // checking on parameters. See the corresponding virtuals for explanations of |
62 // the methods and their arguments. | 62 // the methods and their arguments. |
63 int NotifyBeforeURLRequest(URLRequest* request, | 63 int NotifyBeforeURLRequest(URLRequest* request, |
64 const CompletionCallback& callback, | 64 const CompletionCallback& callback, |
65 GURL* new_url); | 65 GURL* new_url); |
66 void NotifyResolveProxy(const GURL& url, | 66 void NotifyResolveProxy(const GURL& url, |
67 int load_flags, | 67 int load_flags, |
68 const ProxyService& proxy_service, | 68 const ProxyService& proxy_service, |
69 ProxyInfo* result); | 69 ProxyInfo* result); |
70 void NotifyProxyFallback(const ProxyServer& bad_proxy, | 70 void NotifyProxyFallback(const ProxyServer& bad_proxy, |
71 int net_error, | 71 int net_error); |
Ryan Sleevi
2014/08/15 00:02:23
format.
Not at Google. Contact bengr
2014/08/15 17:26:59
Done.
| |
72 bool did_fallback); | |
73 int NotifyBeforeSendHeaders(URLRequest* request, | 72 int NotifyBeforeSendHeaders(URLRequest* request, |
74 const CompletionCallback& callback, | 73 const CompletionCallback& callback, |
75 HttpRequestHeaders* headers); | 74 HttpRequestHeaders* headers); |
76 void NotifyBeforeSendProxyHeaders(URLRequest* request, | 75 void NotifyBeforeSendProxyHeaders(URLRequest* request, |
77 const ProxyInfo& proxy_info, | 76 const ProxyInfo& proxy_info, |
78 HttpRequestHeaders* headers); | 77 HttpRequestHeaders* headers); |
79 void NotifySendHeaders(URLRequest* request, | 78 void NotifySendHeaders(URLRequest* request, |
80 const HttpRequestHeaders& headers); | 79 const HttpRequestHeaders& headers); |
81 int NotifyHeadersReceived( | 80 int NotifyHeadersReceived( |
82 URLRequest* request, | 81 URLRequest* request, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
131 GURL* new_url); | 130 GURL* new_url); |
132 | 131 |
133 // Called as the proxy is being resolved for |url|. Allows the delegate to | 132 // Called as the proxy is being resolved for |url|. Allows the delegate to |
134 // override the proxy resolution decision made by ProxyService. The delegate | 133 // override the proxy resolution decision made by ProxyService. The delegate |
135 // may override the decision by modifying the ProxyInfo |result|. | 134 // may override the decision by modifying the ProxyInfo |result|. |
136 virtual void OnResolveProxy(const GURL& url, | 135 virtual void OnResolveProxy(const GURL& url, |
137 int load_flags, | 136 int load_flags, |
138 const ProxyService& proxy_service, | 137 const ProxyService& proxy_service, |
139 ProxyInfo* result); | 138 ProxyInfo* result); |
140 | 139 |
141 // Called when use of |bad_proxy| fails due to |net_error|. |did_fallback| is | 140 // Called when use of |bad_proxy| fails due to |net_error|. |net_error| is |
142 // true if the proxy service was able to fallback to another proxy | 141 // the network error encountered, if any, and OK if the fallback was |
143 // configuration. | 142 // for a reason other than network error. |
Ryan Sleevi
2014/08/15 00:02:23
What's a reason for fallback OTHER than a network
Not at Google. Contact bengr
2014/08/15 17:26:59
Added clarification. Please check that it provides
| |
144 virtual void OnProxyFallback(const ProxyServer& bad_proxy, | 143 virtual void OnProxyFallback(const ProxyServer& bad_proxy, |
145 int net_error, | 144 int net_error); |
146 bool did_fallback); | |
147 | 145 |
148 // Called right before the HTTP headers are sent. Allows the delegate to | 146 // Called right before the HTTP headers are sent. Allows the delegate to |
149 // read/write |headers| before they get sent out. |callback| and |headers| are | 147 // read/write |headers| before they get sent out. |callback| and |headers| are |
150 // valid only until OnCompleted or OnURLRequestDestroyed is called for this | 148 // valid only until OnCompleted or OnURLRequestDestroyed is called for this |
151 // request. | 149 // request. |
152 // See OnBeforeURLRequest for return value description. Returns OK by default. | 150 // See OnBeforeURLRequest for return value description. Returns OK by default. |
153 virtual int OnBeforeSendHeaders(URLRequest* request, | 151 virtual int OnBeforeSendHeaders(URLRequest* request, |
154 const CompletionCallback& callback, | 152 const CompletionCallback& callback, |
155 HttpRequestHeaders* headers); | 153 HttpRequestHeaders* headers); |
156 | 154 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
269 | 267 |
270 // Called before a SocketStream tries to connect. | 268 // Called before a SocketStream tries to connect. |
271 // See OnBeforeURLRequest for return value description. Returns OK by default. | 269 // See OnBeforeURLRequest for return value description. Returns OK by default. |
272 virtual int OnBeforeSocketStreamConnect( | 270 virtual int OnBeforeSocketStreamConnect( |
273 SocketStream* socket, const CompletionCallback& callback); | 271 SocketStream* socket, const CompletionCallback& callback); |
274 }; | 272 }; |
275 | 273 |
276 } // namespace net | 274 } // namespace net |
277 | 275 |
278 #endif // NET_BASE_NETWORK_DELEGATE_H_ | 276 #endif // NET_BASE_NETWORK_DELEGATE_H_ |
OLD | NEW |