OLD | NEW |
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_LIST_H_ | 5 #ifndef NET_PROXY_PROXY_LIST_H_ |
6 #define NET_PROXY_PROXY_LIST_H_ | 6 #define NET_PROXY_PROXY_LIST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // Returns the number of proxy servers in this list. | 56 // Returns the number of proxy servers in this list. |
57 size_t size() const; | 57 size_t size() const; |
58 | 58 |
59 // Returns true if |*this| lists the same proxies as |other|. | 59 // Returns true if |*this| lists the same proxies as |other|. |
60 bool Equals(const ProxyList& other) const; | 60 bool Equals(const ProxyList& other) const; |
61 | 61 |
62 // Returns the first proxy server in the list. It is only valid to call | 62 // Returns the first proxy server in the list. It is only valid to call |
63 // this if !IsEmpty(). | 63 // this if !IsEmpty(). |
64 const ProxyServer& Get() const; | 64 const ProxyServer& Get() const; |
65 | 65 |
| 66 // Returns all proxy servers in the list. |
| 67 const std::vector<ProxyServer>& GetAll() const; |
| 68 |
66 // Sets the list by parsing the pac result |pac_string|. | 69 // Sets the list by parsing the pac result |pac_string|. |
67 // Some examples for |pac_string|: | 70 // Some examples for |pac_string|: |
68 // "DIRECT" | 71 // "DIRECT" |
69 // "PROXY foopy1" | 72 // "PROXY foopy1" |
70 // "PROXY foopy1; SOCKS4 foopy2:1188" | 73 // "PROXY foopy1; SOCKS4 foopy2:1188" |
71 // Does a best-effort parse, and silently discards any errors. | 74 // Does a best-effort parse, and silently discards any errors. |
72 void SetFromPacString(const std::string& pac_string); | 75 void SetFromPacString(const std::string& pac_string); |
73 | 76 |
74 // Returns a PAC-style semicolon-separated list of valid proxy servers. | 77 // Returns a PAC-style semicolon-separated list of valid proxy servers. |
75 // For example: "PROXY xxx.xxx.xxx.xxx:xx; SOCKS yyy.yyy.yyy:yy". | 78 // For example: "PROXY xxx.xxx.xxx.xxx:xx; SOCKS yyy.yyy.yyy:yy". |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 int net_error, | 121 int net_error, |
119 const BoundNetLog& net_log) const; | 122 const BoundNetLog& net_log) const; |
120 | 123 |
121 // List of proxies. | 124 // List of proxies. |
122 std::vector<ProxyServer> proxies_; | 125 std::vector<ProxyServer> proxies_; |
123 }; | 126 }; |
124 | 127 |
125 } // namespace net | 128 } // namespace net |
126 | 129 |
127 #endif // NET_PROXY_PROXY_LIST_H_ | 130 #endif // NET_PROXY_PROXY_LIST_H_ |
OLD | NEW |