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

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: Pull proxy list mutation in ProxyService. 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
« net/proxy/proxy_info.h ('K') | « 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::Fallback(ProxyInfo* result, const BoundNetLog& net_log) {
1178 return result->Fallback(proxy_retry_info_, net_log);
1179 }
1180
1177 void ProxyService::ReportSuccess(const ProxyInfo& result) { 1181 void ProxyService::ReportSuccess(const ProxyInfo& result) {
1178 DCHECK(CalledOnValidThread()); 1182 DCHECK(CalledOnValidThread());
1179 1183
1180 const ProxyRetryInfoMap& new_retry_info = result.proxy_retry_info(); 1184 const ProxyRetryInfoMap& new_retry_info = result.proxy_retry_info();
1181 if (new_retry_info.empty()) 1185 if (new_retry_info.empty())
1182 return; 1186 return;
1183 1187
1184 for (ProxyRetryInfoMap::const_iterator iter = new_retry_info.begin(); 1188 for (ProxyRetryInfoMap::const_iterator iter = new_retry_info.begin();
1185 iter != new_retry_info.end(); ++iter) { 1189 iter != new_retry_info.end(); ++iter) {
1186 ProxyRetryInfoMap::iterator existing = proxy_retry_info_.find(iter->first); 1190 ProxyRetryInfoMap::iterator existing = proxy_retry_info_.find(iter->first);
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
1552 OnCompletion(result_); 1556 OnCompletion(result_);
1553 } 1557 }
1554 } 1558 }
1555 1559
1556 void SyncProxyServiceHelper::OnCompletion(int rv) { 1560 void SyncProxyServiceHelper::OnCompletion(int rv) {
1557 result_ = rv; 1561 result_ = rv;
1558 event_.Signal(); 1562 event_.Signal();
1559 } 1563 }
1560 1564
1561 } // namespace net 1565 } // namespace net
OLDNEW
« net/proxy/proxy_info.h ('K') | « net/proxy/proxy_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698