Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: net/proxy/proxy_list.cc

Issue 149191: Whenever proxy configurations contain socks and http/https/ftp proxies, socks... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/proxy/proxy_config_unittest.cc ('k') | net/proxy/proxy_server.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "net/proxy/proxy_list.h" 5 #include "net/proxy/proxy_list.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/string_tokenizer.h" 8 #include "base/string_tokenizer.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 10
11 using base::TimeDelta; 11 using base::TimeDelta;
12 using base::TimeTicks; 12 using base::TimeTicks;
13 13
14 namespace net { 14 namespace net {
15 15
16 void ProxyList::Set(const std::string& proxy_uri_list) { 16 void ProxyList::Set(const std::string& proxy_uri_list) {
17 proxies_.clear(); 17 proxies_.clear();
18 StringTokenizer str_tok(proxy_uri_list, ";"); 18 StringTokenizer str_tok(proxy_uri_list, ";");
19 while (str_tok.GetNext()) { 19 while (str_tok.GetNext()) {
20 ProxyServer uri = ProxyServer::FromURI( 20 ProxyServer uri = ProxyServer::FromURI(
21 str_tok.token_begin(), str_tok.token_end()); 21 str_tok.token_begin(), str_tok.token_end(), ProxyServer::SCHEME_HTTP);
22 // Silently discard malformed inputs. 22 // Silently discard malformed inputs.
23 if (uri.is_valid()) 23 if (uri.is_valid())
24 proxies_.push_back(uri); 24 proxies_.push_back(uri);
25 } 25 }
26 } 26 }
27 27
28 void ProxyList::SetSingleProxyServer(const ProxyServer& proxy_server) { 28 void ProxyList::SetSingleProxyServer(const ProxyServer& proxy_server) {
29 proxies_.clear(); 29 proxies_.clear();
30 if (proxy_server.is_valid()) 30 if (proxy_server.is_valid())
31 proxies_.push_back(proxy_server); 31 proxies_.push_back(proxy_server);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 (*proxy_retry_info)[key] = retry_info; 114 (*proxy_retry_info)[key] = retry_info;
115 } 115 }
116 116
117 // Remove this proxy from our list. 117 // Remove this proxy from our list.
118 proxies_.erase(proxies_.begin()); 118 proxies_.erase(proxies_.begin());
119 119
120 return !proxies_.empty(); 120 return !proxies_.empty();
121 } 121 }
122 122
123 } // namespace net 123 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_config_unittest.cc ('k') | net/proxy/proxy_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698