| 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> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 void SetSingleProxyServer(const ProxyServer& proxy_server); | 33 void SetSingleProxyServer(const ProxyServer& proxy_server); |
| 34 | 34 |
| 35 // De-prioritizes the proxies that we have cached as not working, by moving | 35 // De-prioritizes the proxies that we have cached as not working, by moving |
| 36 // them to the end of the fallback list. | 36 // them to the end of the fallback list. |
| 37 void DeprioritizeBadProxies(const ProxyRetryInfoMap& proxy_retry_info); | 37 void DeprioritizeBadProxies(const ProxyRetryInfoMap& proxy_retry_info); |
| 38 | 38 |
| 39 // Delete any entry which doesn't have one of the specified proxy schemes. | 39 // Delete any entry which doesn't have one of the specified proxy schemes. |
| 40 // |scheme_bit_field| is a bunch of ProxyServer::Scheme bitwise ORed together. | 40 // |scheme_bit_field| is a bunch of ProxyServer::Scheme bitwise ORed together. |
| 41 void RemoveProxiesWithoutScheme(int scheme_bit_field); | 41 void RemoveProxiesWithoutScheme(int scheme_bit_field); |
| 42 | 42 |
| 43 // Clear the proxy list. |
| 44 void Clear(); |
| 45 |
| 43 // Returns true if there is nothing left in the ProxyList. | 46 // Returns true if there is nothing left in the ProxyList. |
| 44 bool IsEmpty() const; | 47 bool IsEmpty() const; |
| 45 | 48 |
| 46 // Returns the first proxy server in the list. It is only valid to call | 49 // Returns the first proxy server in the list. It is only valid to call |
| 47 // this if !IsEmpty(). | 50 // this if !IsEmpty(). |
| 48 const ProxyServer& Get() const; | 51 const ProxyServer& Get() const; |
| 49 | 52 |
| 50 // Sets the list by parsing the pac result |pac_string|. | 53 // Sets the list by parsing the pac result |pac_string|. |
| 51 // Some examples for |pac_string|: | 54 // Some examples for |pac_string|: |
| 52 // "DIRECT" | 55 // "DIRECT" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 66 const BoundNetLog& net_log); | 69 const BoundNetLog& net_log); |
| 67 | 70 |
| 68 private: | 71 private: |
| 69 // List of proxies. | 72 // List of proxies. |
| 70 std::vector<ProxyServer> proxies_; | 73 std::vector<ProxyServer> proxies_; |
| 71 }; | 74 }; |
| 72 | 75 |
| 73 } // namespace net | 76 } // namespace net |
| 74 | 77 |
| 75 #endif // NET_PROXY_PROXY_LIST_H_ | 78 #endif // NET_PROXY_PROXY_LIST_H_ |
| OLD | NEW |