| 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" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
| 15 #include "base/message_loop/message_loop_proxy.h" | 15 #include "base/message_loop/message_loop_proxy.h" |
| 16 #include "base/profiler/scoped_tracker.h" |
| 16 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
| 17 #include "base/thread_task_runner_handle.h" | 18 #include "base/thread_task_runner_handle.h" |
| 18 #include "base/values.h" | 19 #include "base/values.h" |
| 19 #include "net/base/completion_callback.h" | 20 #include "net/base/completion_callback.h" |
| 20 #include "net/base/load_flags.h" | 21 #include "net/base/load_flags.h" |
| 21 #include "net/base/net_errors.h" | 22 #include "net/base/net_errors.h" |
| 22 #include "net/base/net_log.h" | 23 #include "net/base/net_log.h" |
| 23 #include "net/base/net_util.h" | 24 #include "net/base/net_util.h" |
| 24 #include "net/proxy/dhcp_proxy_script_fetcher.h" | 25 #include "net/proxy/dhcp_proxy_script_fetcher.h" |
| 25 #include "net/proxy/multi_threaded_proxy_resolver.h" | 26 #include "net/proxy/multi_threaded_proxy_resolver.h" |
| (...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1472 | 1473 |
| 1473 // static | 1474 // static |
| 1474 scoped_ptr<ProxyService::PacPollPolicy> | 1475 scoped_ptr<ProxyService::PacPollPolicy> |
| 1475 ProxyService::CreateDefaultPacPollPolicy() { | 1476 ProxyService::CreateDefaultPacPollPolicy() { |
| 1476 return scoped_ptr<PacPollPolicy>(new DefaultPollPolicy()); | 1477 return scoped_ptr<PacPollPolicy>(new DefaultPollPolicy()); |
| 1477 } | 1478 } |
| 1478 | 1479 |
| 1479 void ProxyService::OnProxyConfigChanged( | 1480 void ProxyService::OnProxyConfigChanged( |
| 1480 const ProxyConfig& config, | 1481 const ProxyConfig& config, |
| 1481 ProxyConfigService::ConfigAvailability availability) { | 1482 ProxyConfigService::ConfigAvailability availability) { |
| 1483 // TODO(pkasting): Remove ScopedTracker below once crbug.com/455942 is fixed. |
| 1484 tracked_objects::ScopedTracker tracking_profile( |
| 1485 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 1486 "455942 ProxyService::OnProxyConfigChanged")); |
| 1482 // Retrieve the current proxy configuration from the ProxyConfigService. | 1487 // Retrieve the current proxy configuration from the ProxyConfigService. |
| 1483 // If a configuration is not available yet, we will get called back later | 1488 // If a configuration is not available yet, we will get called back later |
| 1484 // by our ProxyConfigService::Observer once it changes. | 1489 // by our ProxyConfigService::Observer once it changes. |
| 1485 ProxyConfig effective_config; | 1490 ProxyConfig effective_config; |
| 1486 switch (availability) { | 1491 switch (availability) { |
| 1487 case ProxyConfigService::CONFIG_PENDING: | 1492 case ProxyConfigService::CONFIG_PENDING: |
| 1488 // ProxyConfigService implementors should never pass CONFIG_PENDING. | 1493 // ProxyConfigService implementors should never pass CONFIG_PENDING. |
| 1489 NOTREACHED() << "Proxy config change with CONFIG_PENDING availability!"; | 1494 NOTREACHED() << "Proxy config change with CONFIG_PENDING availability!"; |
| 1490 return; | 1495 return; |
| 1491 case ProxyConfigService::CONFIG_VALID: | 1496 case ProxyConfigService::CONFIG_VALID: |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1580 State previous_state = ResetProxyConfig(false); | 1585 State previous_state = ResetProxyConfig(false); |
| 1581 if (previous_state != STATE_NONE) | 1586 if (previous_state != STATE_NONE) |
| 1582 ApplyProxyConfigIfAvailable(); | 1587 ApplyProxyConfigIfAvailable(); |
| 1583 } | 1588 } |
| 1584 | 1589 |
| 1585 void ProxyService::OnDNSChanged() { | 1590 void ProxyService::OnDNSChanged() { |
| 1586 OnIPAddressChanged(); | 1591 OnIPAddressChanged(); |
| 1587 } | 1592 } |
| 1588 | 1593 |
| 1589 } // namespace net | 1594 } // namespace net |
| OLD | NEW |