| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_LIST_H_ | 5 #ifndef NET_PROXY_PROXY_LIST_H_ |
| 6 #define NET_PROXY_PROXY_LIST_H_ | 6 #define NET_PROXY_PROXY_LIST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "net/base/net_export.h" | 12 #include "net/base/net_export.h" |
| 13 #include "net/base/net_log.h" |
| 13 #include "net/proxy/proxy_retry_info.h" | 14 #include "net/proxy/proxy_retry_info.h" |
| 14 | 15 |
| 15 namespace net { | 16 namespace net { |
| 16 | 17 |
| 17 class ProxyServer; | 18 class ProxyServer; |
| 18 | 19 |
| 19 // This class is used to hold a list of proxies returned by GetProxyForUrl or | 20 // This class is used to hold a list of proxies returned by GetProxyForUrl or |
| 20 // manually configured. It handles proxy fallback if multiple servers are | 21 // manually configured. It handles proxy fallback if multiple servers are |
| 21 // specified. | 22 // specified. |
| 22 class NET_EXPORT_PRIVATE ProxyList { | 23 class NET_EXPORT_PRIVATE ProxyList { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // Does a best-effort parse, and silently discards any errors. | 55 // Does a best-effort parse, and silently discards any errors. |
| 55 void SetFromPacString(const std::string& pac_string); | 56 void SetFromPacString(const std::string& pac_string); |
| 56 | 57 |
| 57 // Returns a PAC-style semicolon-separated list of valid proxy servers. | 58 // Returns a PAC-style semicolon-separated list of valid proxy servers. |
| 58 // For example: "PROXY xxx.xxx.xxx.xxx:xx; SOCKS yyy.yyy.yyy:yy". | 59 // For example: "PROXY xxx.xxx.xxx.xxx:xx; SOCKS yyy.yyy.yyy:yy". |
| 59 std::string ToPacString() const; | 60 std::string ToPacString() const; |
| 60 | 61 |
| 61 // Marks the current proxy server as bad and deletes it from the list. The | 62 // Marks the current proxy server as bad and deletes it from the list. The |
| 62 // list of known bad proxies is given by proxy_retry_info. Returns true if | 63 // list of known bad proxies is given by proxy_retry_info. Returns true if |
| 63 // there is another server available in the list. | 64 // there is another server available in the list. |
| 64 bool Fallback(ProxyRetryInfoMap* proxy_retry_info); | 65 bool Fallback(ProxyRetryInfoMap* proxy_retry_info, |
| 66 const BoundNetLog& net_log); |
| 65 | 67 |
| 66 private: | 68 private: |
| 67 // List of proxies. | 69 // List of proxies. |
| 68 std::vector<ProxyServer> proxies_; | 70 std::vector<ProxyServer> proxies_; |
| 69 }; | 71 }; |
| 70 | 72 |
| 71 } // namespace net | 73 } // namespace net |
| 72 | 74 |
| 73 #endif // NET_PROXY_PROXY_LIST_H_ | 75 #endif // NET_PROXY_PROXY_LIST_H_ |
| OLD | NEW |