| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/init_proxy_resolver.h" | 5 #include "net/proxy/init_proxy_resolver.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 } | 158 } |
| 159 | 159 |
| 160 int InitProxyResolver::DoWait() { | 160 int InitProxyResolver::DoWait() { |
| 161 next_state_ = STATE_WAIT_COMPLETE; | 161 next_state_ = STATE_WAIT_COMPLETE; |
| 162 | 162 |
| 163 // If no waiting is required, continue on to the next state. | 163 // If no waiting is required, continue on to the next state. |
| 164 if (wait_delay_.ToInternalValue() == 0) | 164 if (wait_delay_.ToInternalValue() == 0) |
| 165 return OK; | 165 return OK; |
| 166 | 166 |
| 167 // Otherwise wait the specified amount of time. | 167 // Otherwise wait the specified amount of time. |
| 168 wait_timer_.Start(FROM_HERE, wait_delay_, this, | 168 wait_timer_.Start(wait_delay_, this, &InitProxyResolver::OnWaitTimerFired); |
| 169 &InitProxyResolver::OnWaitTimerFired); | |
| 170 net_log_.BeginEvent(NetLog::TYPE_INIT_PROXY_RESOLVER_WAIT, NULL); | 169 net_log_.BeginEvent(NetLog::TYPE_INIT_PROXY_RESOLVER_WAIT, NULL); |
| 171 return ERR_IO_PENDING; | 170 return ERR_IO_PENDING; |
| 172 } | 171 } |
| 173 | 172 |
| 174 int InitProxyResolver::DoWaitComplete(int result) { | 173 int InitProxyResolver::DoWaitComplete(int result) { |
| 175 DCHECK_EQ(OK, result); | 174 DCHECK_EQ(OK, result); |
| 176 if (wait_delay_.ToInternalValue() != 0) { | 175 if (wait_delay_.ToInternalValue() != 0) { |
| 177 net_log_.EndEventWithNetErrorCode(NetLog::TYPE_INIT_PROXY_RESOLVER_WAIT, | 176 net_log_.EndEventWithNetErrorCode(NetLog::TYPE_INIT_PROXY_RESOLVER_WAIT, |
| 178 result); | 177 result); |
| 179 } | 178 } |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 } | 372 } |
| 374 | 373 |
| 375 // This is safe to call in any state. | 374 // This is safe to call in any state. |
| 376 if (dhcp_proxy_script_fetcher_) | 375 if (dhcp_proxy_script_fetcher_) |
| 377 dhcp_proxy_script_fetcher_->Cancel(); | 376 dhcp_proxy_script_fetcher_->Cancel(); |
| 378 | 377 |
| 379 DidCompleteInit(); | 378 DidCompleteInit(); |
| 380 } | 379 } |
| 381 | 380 |
| 382 } // namespace net | 381 } // namespace net |
| OLD | NEW |