| 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_CONFIG_H_ | 5 #ifndef NET_PROXY_PROXY_CONFIG_H_ |
| 6 #define NET_PROXY_PROXY_CONFIG_H_ | 6 #define NET_PROXY_PROXY_CONFIG_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 private: | 103 private: |
| 104 // Returns one of {&proxy_for_http, &proxy_for_https, &proxy_for_ftp} | 104 // Returns one of {&proxy_for_http, &proxy_for_https, &proxy_for_ftp} |
| 105 // or NULL if it is a scheme that we don't have a mapping | 105 // or NULL if it is a scheme that we don't have a mapping |
| 106 // for. Should only call this if the type is TYPE_PROXY_PER_SCHEME. | 106 // for. Should only call this if the type is TYPE_PROXY_PER_SCHEME. |
| 107 ProxyServer* MapUrlSchemeToProxyNoFallback(const std::string& scheme); | 107 ProxyServer* MapUrlSchemeToProxyNoFallback(const std::string& scheme); |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 typedef int ID; | 110 typedef int ID; |
| 111 | 111 |
| 112 // Indicates an invalid proxy config. | 112 // Indicates an invalid proxy config. |
| 113 enum { INVALID_ID = 0 }; | 113 static const ID kInvalidConfigID = 0; |
| 114 | 114 |
| 115 ProxyConfig(); | 115 ProxyConfig(); |
| 116 ProxyConfig(const ProxyConfig& config); | 116 ProxyConfig(const ProxyConfig& config); |
| 117 ~ProxyConfig(); | 117 ~ProxyConfig(); |
| 118 ProxyConfig& operator=(const ProxyConfig& config); | 118 ProxyConfig& operator=(const ProxyConfig& config); |
| 119 | 119 |
| 120 // Used to numerically identify this configuration. | 120 // Used to numerically identify this configuration. |
| 121 ID id() const { return id_; } | 121 ID id() const { return id_; } |
| 122 void set_id(int id) { id_ = id; } | 122 void set_id(int id) { id_ = id; } |
| 123 bool is_valid() const { return id_ != INVALID_ID; } | 123 bool is_valid() const { return id_ != kInvalidConfigID; } |
| 124 | 124 |
| 125 // Returns true if the given config is equivalent to this config. | 125 // Returns true if the given config is equivalent to this config. |
| 126 bool Equals(const ProxyConfig& other) const; | 126 bool Equals(const ProxyConfig& other) const; |
| 127 | 127 |
| 128 // Returns true if this config contains any "automatic" settings. See the | 128 // Returns true if this config contains any "automatic" settings. See the |
| 129 // class description for what that means. | 129 // class description for what that means. |
| 130 bool HasAutomaticSettings() const; | 130 bool HasAutomaticSettings() const; |
| 131 | 131 |
| 132 void ClearAutomaticSettings(); | 132 void ClearAutomaticSettings(); |
| 133 | 133 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 ProxyRules proxy_rules_; | 206 ProxyRules proxy_rules_; |
| 207 | 207 |
| 208 int id_; | 208 int id_; |
| 209 }; | 209 }; |
| 210 | 210 |
| 211 } // namespace net | 211 } // namespace net |
| 212 | 212 |
| 213 | 213 |
| 214 | 214 |
| 215 #endif // NET_PROXY_PROXY_CONFIG_H_ | 215 #endif // NET_PROXY_PROXY_CONFIG_H_ |
| OLD | NEW |