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

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

Issue 896203003: Implement utility-side proxy resolver Mojo service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@proxy-diffbase
Patch Set: fix windows compile Created 5 years, 9 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
« no previous file with comments | « net/proxy/proxy_list.h ('k') | no next file » | 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) 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_list.h" 5 #include "net/proxy/proxy_list.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/string_tokenizer.h" 9 #include "base/strings/string_tokenizer.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 if (size() != other.size()) 102 if (size() != other.size())
103 return false; 103 return false;
104 return proxies_ == other.proxies_; 104 return proxies_ == other.proxies_;
105 } 105 }
106 106
107 const ProxyServer& ProxyList::Get() const { 107 const ProxyServer& ProxyList::Get() const {
108 DCHECK(!proxies_.empty()); 108 DCHECK(!proxies_.empty());
109 return proxies_[0]; 109 return proxies_[0];
110 } 110 }
111 111
112 const std::vector<ProxyServer>& ProxyList::GetAll() const {
113 return proxies_;
114 }
115
112 void ProxyList::SetFromPacString(const std::string& pac_string) { 116 void ProxyList::SetFromPacString(const std::string& pac_string) {
113 base::StringTokenizer entry_tok(pac_string, ";"); 117 base::StringTokenizer entry_tok(pac_string, ";");
114 proxies_.clear(); 118 proxies_.clear();
115 while (entry_tok.GetNext()) { 119 while (entry_tok.GetNext()) {
116 ProxyServer uri = ProxyServer::FromPacString( 120 ProxyServer uri = ProxyServer::FromPacString(
117 entry_tok.token_begin(), entry_tok.token_end()); 121 entry_tok.token_begin(), entry_tok.token_end());
118 // Silently discard malformed inputs. 122 // Silently discard malformed inputs.
119 if (uri.is_valid()) 123 if (uri.is_valid())
120 proxies_.push_back(uri); 124 proxies_.push_back(uri);
121 } 125 }
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 retry_delay, 238 retry_delay,
235 reconsider, 239 reconsider,
236 another_proxy_to_bypass, 240 another_proxy_to_bypass,
237 net_error, 241 net_error,
238 net_log); 242 net_log);
239 } 243 }
240 } 244 }
241 } 245 }
242 246
243 } // namespace net 247 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_list.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698