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

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

Issue 10987043: Receiving Connection: Proxy-Bypass induces proxy fallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Build fix for android_dbg. Created 8 years, 2 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_service.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_service.h" 5 #include "net/proxy/proxy_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 1167
1168 // We don't have new proxy settings to try, try to fallback to the next proxy 1168 // We don't have new proxy settings to try, try to fallback to the next proxy
1169 // in the list. 1169 // in the list.
1170 bool did_fallback = result->Fallback(net_log); 1170 bool did_fallback = result->Fallback(net_log);
1171 1171
1172 // Return synchronous failure if there is nothing left to fall-back to. 1172 // Return synchronous failure if there is nothing left to fall-back to.
1173 // TODO(eroman): This is a yucky API, clean it up. 1173 // TODO(eroman): This is a yucky API, clean it up.
1174 return did_fallback ? OK : ERR_FAILED; 1174 return did_fallback ? OK : ERR_FAILED;
1175 } 1175 }
1176 1176
1177 bool ProxyService::MarkProxyAsBad(const ProxyInfo& result,
1178 const BoundNetLog& net_log) {
1179 result.proxy_list_.UpdateRetryInfoOnFallback(&proxy_retry_info_, net_log);
1180 return result.proxy_list_.HasUntriedProxies(proxy_retry_info_);
1181 }
1182
1177 void ProxyService::ReportSuccess(const ProxyInfo& result) { 1183 void ProxyService::ReportSuccess(const ProxyInfo& result) {
1178 DCHECK(CalledOnValidThread()); 1184 DCHECK(CalledOnValidThread());
1179 1185
1180 const ProxyRetryInfoMap& new_retry_info = result.proxy_retry_info(); 1186 const ProxyRetryInfoMap& new_retry_info = result.proxy_retry_info();
1181 if (new_retry_info.empty()) 1187 if (new_retry_info.empty())
1182 return; 1188 return;
1183 1189
1184 for (ProxyRetryInfoMap::const_iterator iter = new_retry_info.begin(); 1190 for (ProxyRetryInfoMap::const_iterator iter = new_retry_info.begin();
1185 iter != new_retry_info.end(); ++iter) { 1191 iter != new_retry_info.end(); ++iter) {
1186 ProxyRetryInfoMap::iterator existing = proxy_retry_info_.find(iter->first); 1192 ProxyRetryInfoMap::iterator existing = proxy_retry_info_.find(iter->first);
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
1552 OnCompletion(result_); 1558 OnCompletion(result_);
1553 } 1559 }
1554 } 1560 }
1555 1561
1556 void SyncProxyServiceHelper::OnCompletion(int rv) { 1562 void SyncProxyServiceHelper::OnCompletion(int rv) {
1557 result_ = rv; 1563 result_ = rv;
1558 event_.Signal(); 1564 event_.Signal();
1559 } 1565 }
1560 1566
1561 } // namespace net 1567 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698