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

Side by Side Diff: net/proxy/proxy_service.h

Issue 473513002: Keep track of network error in ProxyRetryInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor formatting 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
« no previous file with comments | « net/proxy/proxy_retry_info.h ('k') | net/proxy/proxy_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_PROXY_PROXY_SERVICE_H_ 5 #ifndef NET_PROXY_PROXY_SERVICE_H_
6 #define NET_PROXY_PROXY_SERVICE_H_ 6 #define NET_PROXY_PROXY_SERVICE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 PacRequest** pac_request, 153 PacRequest** pac_request,
154 NetworkDelegate* network_delegate, 154 NetworkDelegate* network_delegate,
155 const BoundNetLog& net_log); 155 const BoundNetLog& net_log);
156 156
157 // Explicitly trigger proxy fallback for the given |results| by updating our 157 // Explicitly trigger proxy fallback for the given |results| by updating our
158 // list of bad proxies to include the first entry of |results|, and, 158 // list of bad proxies to include the first entry of |results|, and,
159 // optionally, another bad proxy. Will retry after |retry_delay| if positive, 159 // optionally, another bad proxy. Will retry after |retry_delay| if positive,
160 // and will use the default proxy retry duration otherwise. Proxies marked as 160 // and will use the default proxy retry duration otherwise. Proxies marked as
161 // bad will not be retried until |retry_delay| has passed. Returns true if 161 // bad will not be retried until |retry_delay| has passed. Returns true if
162 // there will be at least one proxy remaining in the list after fallback and 162 // there will be at least one proxy remaining in the list after fallback and
163 // false otherwise. 163 // false otherwise. This method should be used to add proxies to the bad
164 // proxy list only for reasons other than a network error. If a proxy needs
165 // to be added to the bad proxy list because a network error was encountered
166 // when trying to connect to it, use |ReconsiderProxyAfterError|.
164 bool MarkProxiesAsBadUntil(const ProxyInfo& results, 167 bool MarkProxiesAsBadUntil(const ProxyInfo& results,
165 base::TimeDelta retry_delay, 168 base::TimeDelta retry_delay,
166 const ProxyServer& another_bad_proxy, 169 const ProxyServer& another_bad_proxy,
167 const BoundNetLog& net_log); 170 const BoundNetLog& net_log);
168 171
169 // Called to report that the last proxy connection succeeded. If |proxy_info| 172 // Called to report that the last proxy connection succeeded. If |proxy_info|
170 // has a non empty proxy_retry_info map, the proxies that have been tried (and 173 // has a non empty proxy_retry_info map, the proxies that have been tried (and
171 // failed) for this request will be marked as bad. 174 // failed) for this request will be marked as bad. |network_delegate| will
172 void ReportSuccess(const ProxyInfo& proxy_info); 175 // be notified of any proxy fallbacks.
176 void ReportSuccess(const ProxyInfo& proxy_info,
177 NetworkDelegate* network_delegate);
173 178
174 // Call this method with a non-null |pac_request| to cancel the PAC request. 179 // Call this method with a non-null |pac_request| to cancel the PAC request.
175 void CancelPacRequest(PacRequest* pac_request); 180 void CancelPacRequest(PacRequest* pac_request);
176 181
177 // Returns the LoadState for this |pac_request| which must be non-NULL. 182 // Returns the LoadState for this |pac_request| which must be non-NULL.
178 LoadState GetLoadState(const PacRequest* pac_request) const; 183 LoadState GetLoadState(const PacRequest* pac_request) const;
179 184
180 // Sets the ProxyScriptFetcher and DhcpProxyScriptFetcher dependencies. This 185 // Sets the ProxyScriptFetcher and DhcpProxyScriptFetcher dependencies. This
181 // is needed if the ProxyResolver is of type ProxyResolverWithoutFetch. 186 // is needed if the ProxyResolver is of type ProxyResolverWithoutFetch.
182 // ProxyService takes ownership of both objects. 187 // ProxyService takes ownership of both objects.
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 429
425 // Whether child ProxyScriptDeciders should use QuickCheck 430 // Whether child ProxyScriptDeciders should use QuickCheck
426 bool quick_check_enabled_; 431 bool quick_check_enabled_;
427 432
428 DISALLOW_COPY_AND_ASSIGN(ProxyService); 433 DISALLOW_COPY_AND_ASSIGN(ProxyService);
429 }; 434 };
430 435
431 } // namespace net 436 } // namespace net
432 437
433 #endif // NET_PROXY_PROXY_SERVICE_H_ 438 #endif // NET_PROXY_PROXY_SERVICE_H_
OLDNEW
« no previous file with comments | « net/proxy/proxy_retry_info.h ('k') | net/proxy/proxy_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698