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_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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 proxy_list += ";"; | 139 proxy_list += ";"; |
140 proxy_list += iter->ToPacString(); | 140 proxy_list += iter->ToPacString(); |
141 } | 141 } |
142 return proxy_list.empty() ? std::string() : proxy_list; | 142 return proxy_list.empty() ? std::string() : proxy_list; |
143 } | 143 } |
144 | 144 |
145 scoped_ptr<base::ListValue> ProxyList::ToValue() const { | 145 scoped_ptr<base::ListValue> ProxyList::ToValue() const { |
146 scoped_ptr<base::ListValue> list(new base::ListValue()); | 146 scoped_ptr<base::ListValue> list(new base::ListValue()); |
147 for (size_t i = 0; i < proxies_.size(); ++i) | 147 for (size_t i = 0; i < proxies_.size(); ++i) |
148 list->AppendString(proxies_[i].ToURI()); | 148 list->AppendString(proxies_[i].ToURI()); |
149 return list.Pass(); | 149 return list; |
150 } | 150 } |
151 | 151 |
152 bool ProxyList::Fallback(ProxyRetryInfoMap* proxy_retry_info, | 152 bool ProxyList::Fallback(ProxyRetryInfoMap* proxy_retry_info, |
153 int net_error, | 153 int net_error, |
154 const BoundNetLog& net_log) { | 154 const BoundNetLog& net_log) { |
155 // TODO(eroman): It would be good if instead of removing failed proxies | 155 // TODO(eroman): It would be good if instead of removing failed proxies |
156 // from the list, we simply annotated them with the error code they failed | 156 // from the list, we simply annotated them with the error code they failed |
157 // with. Of course, ProxyService::ReconsiderProxyAfterError() would need to | 157 // with. Of course, ProxyService::ReconsiderProxyAfterError() would need to |
158 // be given this information by the network transaction. | 158 // be given this information by the network transaction. |
159 // | 159 // |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 // If any additional proxies to bypass are specified, add to the retry map | 225 // If any additional proxies to bypass are specified, add to the retry map |
226 // as well. | 226 // as well. |
227 for (const ProxyServer& additional_proxy : additional_proxies_to_bypass) { | 227 for (const ProxyServer& additional_proxy : additional_proxies_to_bypass) { |
228 AddProxyToRetryList(proxy_retry_info, retry_delay, reconsider, | 228 AddProxyToRetryList(proxy_retry_info, retry_delay, reconsider, |
229 additional_proxy, net_error, net_log); | 229 additional_proxy, net_error, net_log); |
230 } | 230 } |
231 } | 231 } |
232 } | 232 } |
233 | 233 |
234 } // namespace net | 234 } // namespace net |
OLD | NEW |