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_CONFIG_H_ | 5 #ifndef NET_PROXY_PROXY_CONFIG_H_ |
6 #define NET_PROXY_PROXY_CONFIG_H_ | 6 #define NET_PROXY_PROXY_CONFIG_H_ |
7 | 7 |
8 #include <ostream> | 8 #include <ostream> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 // Indicates an invalid proxy config. | 22 // Indicates an invalid proxy config. |
23 enum { INVALID_ID = 0 }; | 23 enum { INVALID_ID = 0 }; |
24 | 24 |
25 ProxyConfig(); | 25 ProxyConfig(); |
26 // Default copy-constructor and assignment operator are OK! | 26 // Default copy-constructor and assignment operator are OK! |
27 | 27 |
28 // Used to numerically identify this configuration. | 28 // Used to numerically identify this configuration. |
29 ID id() const { return id_; } | 29 ID id() const { return id_; } |
30 void set_id(int id) { id_ = id; } | 30 void set_id(int id) { id_ = id; } |
| 31 bool is_valid() { return id_ != INVALID_ID; } |
31 | 32 |
32 // True if the proxy configuration should be auto-detected. | 33 // True if the proxy configuration should be auto-detected. |
33 bool auto_detect; | 34 bool auto_detect; |
34 | 35 |
35 // If non-empty, indicates the URL of the proxy auto-config file to use. | 36 // If non-empty, indicates the URL of the proxy auto-config file to use. |
36 GURL pac_url; | 37 GURL pac_url; |
37 | 38 |
38 struct ProxyRules { | 39 struct ProxyRules { |
39 enum Type { | 40 enum Type { |
40 TYPE_NO_RULES, | 41 TYPE_NO_RULES, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // Dumps a human-readable string representation of the configuration to |out|; | 124 // Dumps a human-readable string representation of the configuration to |out|; |
124 // used when logging the configuration changes. | 125 // used when logging the configuration changes. |
125 std::ostream& operator<<(std::ostream& out, const net::ProxyConfig& config); | 126 std::ostream& operator<<(std::ostream& out, const net::ProxyConfig& config); |
126 | 127 |
127 // Dumps a human-readable string representation of the |rules| to |out|; | 128 // Dumps a human-readable string representation of the |rules| to |out|; |
128 // used for logging and for better unittest failure output. | 129 // used for logging and for better unittest failure output. |
129 std::ostream& operator<<(std::ostream& out, | 130 std::ostream& operator<<(std::ostream& out, |
130 const net::ProxyConfig::ProxyRules& rules); | 131 const net::ProxyConfig::ProxyRules& rules); |
131 | 132 |
132 #endif // NET_PROXY_PROXY_CONFIG_H_ | 133 #endif // NET_PROXY_PROXY_CONFIG_H_ |
OLD | NEW |