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

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

Issue 556933003: Pass in bad proxy to NotifyProxyFallback and not the successful one. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add all files to cl Created 6 years, 3 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
« no previous file with comments | « no previous file | net/proxy/proxy_service_unittest.cc » ('j') | 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 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 const ProxyRetryInfoMap& new_retry_info = result.proxy_retry_info(); 1242 const ProxyRetryInfoMap& new_retry_info = result.proxy_retry_info();
1243 if (new_retry_info.empty()) 1243 if (new_retry_info.empty())
1244 return; 1244 return;
1245 1245
1246 for (ProxyRetryInfoMap::const_iterator iter = new_retry_info.begin(); 1246 for (ProxyRetryInfoMap::const_iterator iter = new_retry_info.begin();
1247 iter != new_retry_info.end(); ++iter) { 1247 iter != new_retry_info.end(); ++iter) {
1248 ProxyRetryInfoMap::iterator existing = proxy_retry_info_.find(iter->first); 1248 ProxyRetryInfoMap::iterator existing = proxy_retry_info_.find(iter->first);
1249 if (existing == proxy_retry_info_.end()) { 1249 if (existing == proxy_retry_info_.end()) {
1250 proxy_retry_info_[iter->first] = iter->second; 1250 proxy_retry_info_[iter->first] = iter->second;
1251 if (network_delegate) { 1251 if (network_delegate) {
1252 const ProxyServer& bad_proxy =
1253 ProxyServer::FromURI(iter->first, ProxyServer::SCHEME_HTTP);
1252 const ProxyRetryInfo& proxy_retry_info = iter->second; 1254 const ProxyRetryInfo& proxy_retry_info = iter->second;
bengr 2014/09/09 20:43:30 Is it correct to always use SCHEME_HTTP?
Not at Google. Contact bengr 2014/09/09 20:51:29 SCHEME_HTTP is the default used by the net stack a
1253 network_delegate->NotifyProxyFallback(result.proxy_server(), 1255 network_delegate->NotifyProxyFallback(bad_proxy,
1254 proxy_retry_info.net_error); 1256 proxy_retry_info.net_error);
1255 } 1257 }
1256 } 1258 }
1257 else if (existing->second.bad_until < iter->second.bad_until) 1259 else if (existing->second.bad_until < iter->second.bad_until)
1258 existing->second.bad_until = iter->second.bad_until; 1260 existing->second.bad_until = iter->second.bad_until;
1259 } 1261 }
1260 if (net_log_) { 1262 if (net_log_) {
1261 net_log_->AddGlobalEntry( 1263 net_log_->AddGlobalEntry(
1262 NetLog::TYPE_BAD_PROXY_LIST_REPORTED, 1264 NetLog::TYPE_BAD_PROXY_LIST_REPORTED,
1263 base::Bind(&NetLogBadProxyListCallback, &new_retry_info)); 1265 base::Bind(&NetLogBadProxyListCallback, &new_retry_info));
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
1554 State previous_state = ResetProxyConfig(false); 1556 State previous_state = ResetProxyConfig(false);
1555 if (previous_state != STATE_NONE) 1557 if (previous_state != STATE_NONE)
1556 ApplyProxyConfigIfAvailable(); 1558 ApplyProxyConfigIfAvailable();
1557 } 1559 }
1558 1560
1559 void ProxyService::OnDNSChanged() { 1561 void ProxyService::OnDNSChanged() {
1560 OnIPAddressChanged(); 1562 OnIPAddressChanged();
1561 } 1563 }
1562 1564
1563 } // namespace net 1565 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/proxy/proxy_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698