| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/proxy/proxy_retry_info.h" | 12 #include "net/proxy/proxy_retry_info.h" |
| 13 #include "net/proxy/proxy_server.h" | |
| 14 | 13 |
| 15 namespace net { | 14 namespace net { |
| 16 | 15 |
| 16 class ProxyServer; |
| 17 |
| 17 // This class is used to hold a list of proxies returned by GetProxyForUrl or | 18 // This class is used to hold a list of proxies returned by GetProxyForUrl or |
| 18 // manually configured. It handles proxy fallback if multiple servers are | 19 // manually configured. It handles proxy fallback if multiple servers are |
| 19 // specified. | 20 // specified. |
| 20 class ProxyList { | 21 class ProxyList { |
| 21 public: | 22 public: |
| 23 ProxyList(); |
| 24 ~ProxyList(); |
| 25 |
| 22 // Initializes the proxy list to a string containing one or more proxy servers | 26 // Initializes the proxy list to a string containing one or more proxy servers |
| 23 // delimited by a semicolon. | 27 // delimited by a semicolon. |
| 24 void Set(const std::string& proxy_uri_list); | 28 void Set(const std::string& proxy_uri_list); |
| 25 | 29 |
| 26 // Set the proxy list to a single entry, |proxy_server|. | 30 // Set the proxy list to a single entry, |proxy_server|. |
| 27 void SetSingleProxyServer(const ProxyServer& proxy_server); | 31 void SetSingleProxyServer(const ProxyServer& proxy_server); |
| 28 | 32 |
| 29 // De-prioritizes the proxies that we have cached as not working, by moving | 33 // De-prioritizes the proxies that we have cached as not working, by moving |
| 30 // them to the end of the fallback list. | 34 // them to the end of the fallback list. |
| 31 void DeprioritizeBadProxies(const ProxyRetryInfoMap& proxy_retry_info); | 35 void DeprioritizeBadProxies(const ProxyRetryInfoMap& proxy_retry_info); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 59 bool Fallback(ProxyRetryInfoMap* proxy_retry_info); | 63 bool Fallback(ProxyRetryInfoMap* proxy_retry_info); |
| 60 | 64 |
| 61 private: | 65 private: |
| 62 // List of proxies. | 66 // List of proxies. |
| 63 std::vector<ProxyServer> proxies_; | 67 std::vector<ProxyServer> proxies_; |
| 64 }; | 68 }; |
| 65 | 69 |
| 66 } // namespace net | 70 } // namespace net |
| 67 | 71 |
| 68 #endif // NET_PROXY_PROXY_LIST_H_ | 72 #endif // NET_PROXY_PROXY_LIST_H_ |
| OLD | NEW |