| 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/logging.h" | 8 #include "base/logging.h" |
| 8 #include "base/string_tokenizer.h" | 9 #include "base/string_tokenizer.h" |
| 9 #include "base/time.h" | 10 #include "base/time.h" |
| 10 #include "net/proxy/proxy_server.h" | 11 #include "net/proxy/proxy_server.h" |
| 11 | 12 |
| 12 using base::TimeDelta; | 13 using base::TimeDelta; |
| 13 using base::TimeTicks; | 14 using base::TimeTicks; |
| 14 | 15 |
| 15 namespace net { | 16 namespace net { |
| 16 | 17 |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 if (iter != proxy_retry_info->end()) { | 155 if (iter != proxy_retry_info->end()) { |
| 155 // TODO(nsylvain): This is not the first time we get this. We should | 156 // TODO(nsylvain): This is not the first time we get this. We should |
| 156 // double the retry time. Bug 997660. | 157 // double the retry time. Bug 997660. |
| 157 iter->second.bad_until = TimeTicks::Now() + iter->second.current_delay; | 158 iter->second.bad_until = TimeTicks::Now() + iter->second.current_delay; |
| 158 } else { | 159 } else { |
| 159 ProxyRetryInfo retry_info; | 160 ProxyRetryInfo retry_info; |
| 160 retry_info.current_delay = kProxyRetryDelay; | 161 retry_info.current_delay = kProxyRetryDelay; |
| 161 retry_info.bad_until = TimeTicks().Now() + retry_info.current_delay; | 162 retry_info.bad_until = TimeTicks().Now() + retry_info.current_delay; |
| 162 (*proxy_retry_info)[key] = retry_info; | 163 (*proxy_retry_info)[key] = retry_info; |
| 163 } | 164 } |
| 164 net_log.AddEvent( | 165 net_log.AddEvent(NetLog::TYPE_PROXY_LIST_FALLBACK, |
| 165 NetLog::TYPE_PROXY_LIST_FALLBACK, | 166 NetLog::StringCallback("bad_proxy", &key)); |
| 166 make_scoped_refptr(new NetLogStringParameter("bad_proxy", key))); | |
| 167 } | 167 } |
| 168 | 168 |
| 169 // Remove this proxy from our list. | 169 // Remove this proxy from our list. |
| 170 proxies_.erase(proxies_.begin()); | 170 proxies_.erase(proxies_.begin()); |
| 171 | 171 |
| 172 return !proxies_.empty(); | 172 return !proxies_.empty(); |
| 173 } | 173 } |
| 174 | 174 |
| 175 } // namespace net | 175 } // namespace net |
| OLD | NEW |