| 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_script_decider.h" | 5 #include "net/proxy/proxy_script_decider.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
| 13 #include "base/profiler/scoped_tracker.h" | |
| 14 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 16 #include "base/values.h" | 15 #include "base/values.h" |
| 17 #include "net/base/net_errors.h" | 16 #include "net/base/net_errors.h" |
| 18 #include "net/proxy/dhcp_proxy_script_fetcher.h" | 17 #include "net/proxy/dhcp_proxy_script_fetcher.h" |
| 19 #include "net/proxy/dhcp_proxy_script_fetcher_factory.h" | 18 #include "net/proxy/dhcp_proxy_script_fetcher_factory.h" |
| 20 #include "net/proxy/proxy_script_fetcher.h" | 19 #include "net/proxy/proxy_script_fetcher.h" |
| 21 #include "net/url_request/url_request_context.h" | 20 #include "net/url_request/url_request_context.h" |
| 22 | 21 |
| 23 namespace net { | 22 namespace net { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher, | 80 DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher, |
| 82 NetLog* net_log) | 81 NetLog* net_log) |
| 83 : proxy_script_fetcher_(proxy_script_fetcher), | 82 : proxy_script_fetcher_(proxy_script_fetcher), |
| 84 dhcp_proxy_script_fetcher_(dhcp_proxy_script_fetcher), | 83 dhcp_proxy_script_fetcher_(dhcp_proxy_script_fetcher), |
| 85 current_pac_source_index_(0u), | 84 current_pac_source_index_(0u), |
| 86 pac_mandatory_(false), | 85 pac_mandatory_(false), |
| 87 next_state_(STATE_NONE), | 86 next_state_(STATE_NONE), |
| 88 net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_PROXY_SCRIPT_DECIDER)), | 87 net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_PROXY_SCRIPT_DECIDER)), |
| 89 fetch_pac_bytes_(false), | 88 fetch_pac_bytes_(false), |
| 90 quick_check_enabled_(true) { | 89 quick_check_enabled_(true) { |
| 91 // TODO(pkasting): Remove ScopedTracker below once crbug.com/455942 is fixed. | |
| 92 tracked_objects::ScopedTracker tracking_profile( | |
| 93 FROM_HERE_WITH_EXPLICIT_FUNCTION( | |
| 94 "455942 ProxyScriptDecider::ProxyScriptDecider")); | |
| 95 if (proxy_script_fetcher && | 90 if (proxy_script_fetcher && |
| 96 proxy_script_fetcher->GetRequestContext() && | 91 proxy_script_fetcher->GetRequestContext() && |
| 97 proxy_script_fetcher->GetRequestContext()->host_resolver()) { | 92 proxy_script_fetcher->GetRequestContext()->host_resolver()) { |
| 98 host_resolver_.reset(new SingleRequestHostResolver( | 93 host_resolver_.reset(new SingleRequestHostResolver( |
| 99 proxy_script_fetcher->GetRequestContext()->host_resolver())); | 94 proxy_script_fetcher->GetRequestContext()->host_resolver())); |
| 100 } | 95 } |
| 101 } | 96 } |
| 102 | 97 |
| 103 ProxyScriptDecider::~ProxyScriptDecider() { | 98 ProxyScriptDecider::~ProxyScriptDecider() { |
| 104 if (next_state_ != STATE_NONE) | 99 if (next_state_ != STATE_NONE) |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 } | 470 } |
| 476 | 471 |
| 477 // This is safe to call in any state. | 472 // This is safe to call in any state. |
| 478 if (dhcp_proxy_script_fetcher_) | 473 if (dhcp_proxy_script_fetcher_) |
| 479 dhcp_proxy_script_fetcher_->Cancel(); | 474 dhcp_proxy_script_fetcher_->Cancel(); |
| 480 | 475 |
| 481 DidComplete(); | 476 DidComplete(); |
| 482 } | 477 } |
| 483 | 478 |
| 484 } // namespace net | 479 } // namespace net |
| OLD | NEW |