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 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 ProxyService::ProxyService(ProxyConfigService* config_service, | 897 ProxyService::ProxyService(ProxyConfigService* config_service, |
898 ProxyResolver* resolver, | 898 ProxyResolver* resolver, |
899 NetLog* net_log) | 899 NetLog* net_log) |
900 : resolver_(resolver), | 900 : resolver_(resolver), |
901 next_config_id_(1), | 901 next_config_id_(1), |
902 current_state_(STATE_NONE), | 902 current_state_(STATE_NONE), |
903 net_log_(net_log), | 903 net_log_(net_log), |
904 stall_proxy_auto_config_delay_(TimeDelta::FromMilliseconds( | 904 stall_proxy_auto_config_delay_(TimeDelta::FromMilliseconds( |
905 kDelayAfterNetworkChangesMs)), | 905 kDelayAfterNetworkChangesMs)), |
906 quick_check_enabled_(true) { | 906 quick_check_enabled_(true) { |
| 907 // TODO(eroman): Remove once crbug.com/454983 is solved. |
| 908 tracked_objects::ScopedTracker tracking_profile( |
| 909 FROM_HERE_WITH_EXPLICIT_FUNCTION("454983 ProxyService::ProxyService")); |
907 NetworkChangeNotifier::AddIPAddressObserver(this); | 910 NetworkChangeNotifier::AddIPAddressObserver(this); |
908 NetworkChangeNotifier::AddDNSObserver(this); | 911 NetworkChangeNotifier::AddDNSObserver(this); |
909 ResetConfigService(config_service); | 912 ResetConfigService(config_service); |
910 } | 913 } |
911 | 914 |
912 // static | 915 // static |
913 ProxyService* ProxyService::CreateUsingSystemProxyResolver( | 916 ProxyService* ProxyService::CreateUsingSystemProxyResolver( |
914 ProxyConfigService* proxy_config_service, | 917 ProxyConfigService* proxy_config_service, |
915 size_t num_pac_threads, | 918 size_t num_pac_threads, |
916 NetLog* net_log) { | 919 NetLog* net_log) { |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1414 config_ = ProxyConfig(); | 1417 config_ = ProxyConfig(); |
1415 if (reset_fetched_config) | 1418 if (reset_fetched_config) |
1416 fetched_config_ = ProxyConfig(); | 1419 fetched_config_ = ProxyConfig(); |
1417 current_state_ = STATE_NONE; | 1420 current_state_ = STATE_NONE; |
1418 | 1421 |
1419 return previous_state; | 1422 return previous_state; |
1420 } | 1423 } |
1421 | 1424 |
1422 void ProxyService::ResetConfigService( | 1425 void ProxyService::ResetConfigService( |
1423 ProxyConfigService* new_proxy_config_service) { | 1426 ProxyConfigService* new_proxy_config_service) { |
| 1427 // TODO(eroman): Remove once crbug.com/454983 is solved. |
| 1428 tracked_objects::ScopedTracker tracking_profile( |
| 1429 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 1430 "454983 ProxyService::ResetConfigService")); |
| 1431 |
1424 DCHECK(CalledOnValidThread()); | 1432 DCHECK(CalledOnValidThread()); |
1425 State previous_state = ResetProxyConfig(true); | 1433 State previous_state = ResetProxyConfig(true); |
1426 | 1434 |
1427 // Release the old configuration service. | 1435 // Release the old configuration service. |
1428 if (config_service_.get()) | 1436 if (config_service_.get()) |
1429 config_service_->RemoveObserver(this); | 1437 config_service_->RemoveObserver(this); |
1430 | 1438 |
1431 // Set the new configuration service. | 1439 // Set the new configuration service. |
1432 config_service_.reset(new_proxy_config_service); | 1440 config_service_.reset(new_proxy_config_service); |
1433 config_service_->AddObserver(this); | 1441 config_service_->AddObserver(this); |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1601 State previous_state = ResetProxyConfig(false); | 1609 State previous_state = ResetProxyConfig(false); |
1602 if (previous_state != STATE_NONE) | 1610 if (previous_state != STATE_NONE) |
1603 ApplyProxyConfigIfAvailable(); | 1611 ApplyProxyConfigIfAvailable(); |
1604 } | 1612 } |
1605 | 1613 |
1606 void ProxyService::OnDNSChanged() { | 1614 void ProxyService::OnDNSChanged() { |
1607 OnIPAddressChanged(); | 1615 OnIPAddressChanged(); |
1608 } | 1616 } |
1609 | 1617 |
1610 } // namespace net | 1618 } // namespace net |
OLD | NEW |