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_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 <string> | 8 #include <string> |
9 | 9 |
10 #include "net/base/net_export.h" | 10 #include "net/base/net_export.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 ProxyList proxies_for_http; | 131 ProxyList proxies_for_http; |
132 ProxyList proxies_for_https; | 132 ProxyList proxies_for_https; |
133 ProxyList proxies_for_ftp; | 133 ProxyList proxies_for_ftp; |
134 | 134 |
135 // Used when a fallback has been defined and the url to be proxied doesn't | 135 // Used when a fallback has been defined and the url to be proxied doesn't |
136 // match any of the standard schemes. | 136 // match any of the standard schemes. |
137 ProxyList fallback_proxies; | 137 ProxyList fallback_proxies; |
138 | 138 |
139 private: | 139 private: |
140 // Returns one of {&proxies_for_http, &proxies_for_https, &proxies_for_ftp} | 140 // Returns one of {&proxies_for_http, &proxies_for_https, &proxies_for_ftp} |
141 // or NULL if it is a scheme that we don't have a mapping | 141 // or NULL if it is a scheme that we don't have a mapping for. Should only |
142 // for. Should only call this if the type is TYPE_PROXY_PER_SCHEME. | 142 // call this if the type is TYPE_PROXY_PER_SCHEME. Intentionally returns |
| 143 // NULL for "ws" and "wss" as those are handled specially by |
| 144 // GetProxyListForWebSocketScheme(). |
143 ProxyList* MapUrlSchemeToProxyListNoFallback(const std::string& scheme); | 145 ProxyList* MapUrlSchemeToProxyListNoFallback(const std::string& scheme); |
| 146 |
| 147 // Returns the first of {&fallback_proxies, &proxies_for_https, |
| 148 // &proxies_for_http} that is non-empty, or NULL. |
| 149 const ProxyList* GetProxyListForWebSocketScheme() const; |
144 }; | 150 }; |
145 | 151 |
146 typedef int ID; | 152 typedef int ID; |
147 | 153 |
148 // Indicates an invalid proxy config. | 154 // Indicates an invalid proxy config. |
149 static const ID kInvalidConfigID = 0; | 155 static const ID kInvalidConfigID = 0; |
150 | 156 |
151 ProxyConfig(); | 157 ProxyConfig(); |
152 ProxyConfig(const ProxyConfig& config); | 158 ProxyConfig(const ProxyConfig& config); |
153 ~ProxyConfig(); | 159 ~ProxyConfig(); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 ProxyConfigSource source_; | 260 ProxyConfigSource source_; |
255 | 261 |
256 ID id_; | 262 ID id_; |
257 }; | 263 }; |
258 | 264 |
259 } // namespace net | 265 } // namespace net |
260 | 266 |
261 | 267 |
262 | 268 |
263 #endif // NET_PROXY_PROXY_CONFIG_H_ | 269 #endif // NET_PROXY_PROXY_CONFIG_H_ |
OLD | NEW |