Chromium Code Reviews| 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_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 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1200 bool re_resolve = result->config_id_ != config_.id(); | 1200 bool re_resolve = result->config_id_ != config_.id(); |
| 1201 | 1201 |
| 1202 if (re_resolve) { | 1202 if (re_resolve) { |
| 1203 // If we have a new config or the config was never tried, we delete the | 1203 // If we have a new config or the config was never tried, we delete the |
| 1204 // list of bad proxies and we try again. | 1204 // list of bad proxies and we try again. |
| 1205 proxy_retry_info_.clear(); | 1205 proxy_retry_info_.clear(); |
| 1206 return ResolveProxy(url, load_flags, result, callback, pac_request, | 1206 return ResolveProxy(url, load_flags, result, callback, pac_request, |
| 1207 network_delegate, net_log); | 1207 network_delegate, net_log); |
| 1208 } | 1208 } |
| 1209 | 1209 |
| 1210 #if defined(SPDY_PROXY_AUTH_ORIGIN) | |
| 1211 if (result->proxy_server().isDataReductionProxy()) { | 1210 if (result->proxy_server().isDataReductionProxy()) { |
|
bengr
2014/07/11 20:42:54
We should embed this logic into ProxyService inste
| |
| 1212 RecordDataReductionProxyBypassInfo( | 1211 RecordDataReductionProxyBypassInfo( |
| 1213 true, false, result->proxy_server(), NETWORK_ERROR); | 1212 true, false, result->proxy_server(), NETWORK_ERROR); |
| 1214 RecordDataReductionProxyBypassOnNetworkError( | 1213 RecordDataReductionProxyBypassOnNetworkError( |
| 1215 true, result->proxy_server(), net_error); | 1214 true, result->proxy_server(), net_error); |
| 1216 } else if (result->proxy_server().isDataReductionProxyFallback()) { | 1215 } else if (result->proxy_server().isDataReductionProxyFallback()) { |
| 1217 RecordDataReductionProxyBypassInfo( | 1216 RecordDataReductionProxyBypassInfo( |
| 1218 false, false, result->proxy_server(), NETWORK_ERROR); | 1217 false, false, result->proxy_server(), NETWORK_ERROR); |
| 1219 RecordDataReductionProxyBypassOnNetworkError( | 1218 RecordDataReductionProxyBypassOnNetworkError( |
| 1220 false, result->proxy_server(), net_error); | 1219 false, result->proxy_server(), net_error); |
| 1221 } | 1220 } |
| 1222 #endif | |
| 1223 | 1221 |
| 1224 // We don't have new proxy settings to try, try to fallback to the next proxy | 1222 // We don't have new proxy settings to try, try to fallback to the next proxy |
| 1225 // in the list. | 1223 // in the list. |
| 1226 bool did_fallback = result->Fallback(net_log); | 1224 bool did_fallback = result->Fallback(net_log); |
| 1227 | 1225 |
| 1228 // Return synchronous failure if there is nothing left to fall-back to. | 1226 // Return synchronous failure if there is nothing left to fall-back to. |
| 1229 // TODO(eroman): This is a yucky API, clean it up. | 1227 // TODO(eroman): This is a yucky API, clean it up. |
| 1230 return did_fallback ? OK : ERR_FAILED; | 1228 return did_fallback ? OK : ERR_FAILED; |
| 1231 } | 1229 } |
| 1232 | 1230 |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1610 State previous_state = ResetProxyConfig(false); | 1608 State previous_state = ResetProxyConfig(false); |
| 1611 if (previous_state != STATE_NONE) | 1609 if (previous_state != STATE_NONE) |
| 1612 ApplyProxyConfigIfAvailable(); | 1610 ApplyProxyConfigIfAvailable(); |
| 1613 } | 1611 } |
| 1614 | 1612 |
| 1615 void ProxyService::OnDNSChanged() { | 1613 void ProxyService::OnDNSChanged() { |
| 1616 OnIPAddressChanged(); | 1614 OnIPAddressChanged(); |
| 1617 } | 1615 } |
| 1618 | 1616 |
| 1619 } // namespace net | 1617 } // namespace net |
| OLD | NEW |