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

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

Issue 10534132: NetLogEventParameter to Callback refactoring 7. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Remove unneeded variable Created 8 years, 6 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
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/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
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
OLDNEW
« no previous file with comments | « net/proxy/multi_threaded_proxy_resolver_unittest.cc ('k') | net/proxy/proxy_resolver_js_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698