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 #include "net/proxy/proxy_config.h" | 5 #include "net/proxy/proxy_config.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/string_tokenizer.h" | 9 #include "base/strings/string_tokenizer.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 if (type == TYPE_PROXY_PER_SCHEME) | 105 if (type == TYPE_PROXY_PER_SCHEME) |
106 continue; // Unexpected. | 106 continue; // Unexpected. |
107 AddProxyURIListToProxyList(url_scheme, | 107 AddProxyURIListToProxyList(url_scheme, |
108 &single_proxies, | 108 &single_proxies, |
109 ProxyServer::SCHEME_HTTP); | 109 ProxyServer::SCHEME_HTTP); |
110 type = TYPE_SINGLE_PROXY; | 110 type = TYPE_SINGLE_PROXY; |
111 return; | 111 return; |
112 } | 112 } |
113 | 113 |
114 // Trim whitespace off the url scheme. | 114 // Trim whitespace off the url scheme. |
115 TrimWhitespaceASCII(url_scheme, TRIM_ALL, &url_scheme); | 115 base::TrimWhitespaceASCII(url_scheme, base::TRIM_ALL, &url_scheme); |
116 | 116 |
117 // Add it to the per-scheme mappings (if supported scheme). | 117 // Add it to the per-scheme mappings (if supported scheme). |
118 type = TYPE_PROXY_PER_SCHEME; | 118 type = TYPE_PROXY_PER_SCHEME; |
119 ProxyList* entry = MapUrlSchemeToProxyListNoFallback(url_scheme); | 119 ProxyList* entry = MapUrlSchemeToProxyListNoFallback(url_scheme); |
120 ProxyServer::Scheme default_scheme = ProxyServer::SCHEME_HTTP; | 120 ProxyServer::Scheme default_scheme = ProxyServer::SCHEME_HTTP; |
121 | 121 |
122 // socks=XXX is inconsistent with the other formats, since "socks" | 122 // socks=XXX is inconsistent with the other formats, since "socks" |
123 // is not a URL scheme. Rather this means "for everything else, send | 123 // is not a URL scheme. Rather this means "for everything else, send |
124 // it to the SOCKS proxy server XXX". | 124 // it to the SOCKS proxy server XXX". |
125 if (url_scheme == "socks") { | 125 if (url_scheme == "socks") { |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 } | 268 } |
269 } | 269 } |
270 | 270 |
271 // Output the source. | 271 // Output the source. |
272 dict->SetString("source", ProxyConfigSourceToString(source_)); | 272 dict->SetString("source", ProxyConfigSourceToString(source_)); |
273 | 273 |
274 return dict; | 274 return dict; |
275 } | 275 } |
276 | 276 |
277 } // namespace net | 277 } // namespace net |
OLD | NEW |