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

Side by Side Diff: net/base/network_delegate.h

Issue 473513002: Keep track of network error in ProxyRetryInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments by rsleevi - 2 Created 6 years, 4 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
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);
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
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 (eg. a component wants to add the
143 // proxy to the retry list so that it is not used).
Ryan Sleevi 2014/08/15 18:02:36 Great, the overall comments have helped better und
Not at Google. Contact bengr 2014/08/15 19:56:53 Done.
144 virtual void OnProxyFallback(const ProxyServer& bad_proxy, 144 virtual void OnProxyFallback(const ProxyServer& bad_proxy,
145 int net_error, 145 int net_error);
146 bool did_fallback);
147 146
148 // Called right before the HTTP headers are sent. Allows the delegate to 147 // 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 148 // read/write |headers| before they get sent out. |callback| and |headers| are
150 // valid only until OnCompleted or OnURLRequestDestroyed is called for this 149 // valid only until OnCompleted or OnURLRequestDestroyed is called for this
151 // request. 150 // request.
152 // See OnBeforeURLRequest for return value description. Returns OK by default. 151 // See OnBeforeURLRequest for return value description. Returns OK by default.
153 virtual int OnBeforeSendHeaders(URLRequest* request, 152 virtual int OnBeforeSendHeaders(URLRequest* request,
154 const CompletionCallback& callback, 153 const CompletionCallback& callback,
155 HttpRequestHeaders* headers); 154 HttpRequestHeaders* headers);
156 155
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 268
270 // Called before a SocketStream tries to connect. 269 // Called before a SocketStream tries to connect.
271 // See OnBeforeURLRequest for return value description. Returns OK by default. 270 // See OnBeforeURLRequest for return value description. Returns OK by default.
272 virtual int OnBeforeSocketStreamConnect( 271 virtual int OnBeforeSocketStreamConnect(
273 SocketStream* socket, const CompletionCallback& callback); 272 SocketStream* socket, const CompletionCallback& callback);
274 }; 273 };
275 274
276 } // namespace net 275 } // namespace net
277 276
278 #endif // NET_BASE_NETWORK_DELEGATE_H_ 277 #endif // NET_BASE_NETWORK_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698