| 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" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 if (config.auto_detect()) { | 160 if (config.auto_detect()) { |
| 161 pac_sources.push_back(PacSource(PacSource::WPAD_DHCP, GURL(kWpadUrl))); | 161 pac_sources.push_back(PacSource(PacSource::WPAD_DHCP, GURL(kWpadUrl))); |
| 162 pac_sources.push_back(PacSource(PacSource::WPAD_DNS, GURL(kWpadUrl))); | 162 pac_sources.push_back(PacSource(PacSource::WPAD_DNS, GURL(kWpadUrl))); |
| 163 } | 163 } |
| 164 if (config.has_pac_url()) | 164 if (config.has_pac_url()) |
| 165 pac_sources.push_back(PacSource(PacSource::CUSTOM, config.pac_url())); | 165 pac_sources.push_back(PacSource(PacSource::CUSTOM, config.pac_url())); |
| 166 return pac_sources; | 166 return pac_sources; |
| 167 } | 167 } |
| 168 | 168 |
| 169 void ProxyScriptDecider::OnIOCompletion(int result) { | 169 void ProxyScriptDecider::OnIOCompletion(int result) { |
| 170 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436634 is fixed. | |
| 171 tracked_objects::ScopedTracker tracking_profile( | |
| 172 FROM_HERE_WITH_EXPLICIT_FUNCTION( | |
| 173 "436634 ProxyScriptDecider::OnIOCompletion")); | |
| 174 | |
| 175 DCHECK_NE(STATE_NONE, next_state_); | 170 DCHECK_NE(STATE_NONE, next_state_); |
| 176 int rv = DoLoop(result); | 171 int rv = DoLoop(result); |
| 177 if (rv != ERR_IO_PENDING) { | 172 if (rv != ERR_IO_PENDING) { |
| 178 DidComplete(); | 173 DidComplete(); |
| 179 DoCallback(rv); | 174 DoCallback(rv); |
| 180 } | 175 } |
| 181 } | 176 } |
| 182 | 177 |
| 183 int ProxyScriptDecider::DoLoop(int result) { | 178 int ProxyScriptDecider::DoLoop(int result) { |
| 184 DCHECK_NE(next_state_, STATE_NONE); | 179 DCHECK_NE(next_state_, STATE_NONE); |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 } | 475 } |
| 481 | 476 |
| 482 // This is safe to call in any state. | 477 // This is safe to call in any state. |
| 483 if (dhcp_proxy_script_fetcher_) | 478 if (dhcp_proxy_script_fetcher_) |
| 484 dhcp_proxy_script_fetcher_->Cancel(); | 479 dhcp_proxy_script_fetcher_->Cancel(); |
| 485 | 480 |
| 486 DidComplete(); | 481 DidComplete(); |
| 487 } | 482 } |
| 488 | 483 |
| 489 } // namespace net | 484 } // namespace net |
| OLD | NEW |