| 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/dhcp_proxy_script_adapter_fetcher_win.h" | 5 #include "net/proxy/dhcp_proxy_script_adapter_fetcher_win.h" |
| 6 | 6 |
| 7 #include "base/message_loop_proxy.h" | 7 #include "base/message_loop_proxy.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
| 10 #include "base/task.h" | 10 #include "base/task.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 void DhcpProxyScriptAdapterFetcher::Fetch( | 52 void DhcpProxyScriptAdapterFetcher::Fetch( |
| 53 const std::string& adapter_name, CompletionCallback* callback) { | 53 const std::string& adapter_name, CompletionCallback* callback) { |
| 54 DCHECK(CalledOnValidThread()); | 54 DCHECK(CalledOnValidThread()); |
| 55 DCHECK_EQ(state_, STATE_START); | 55 DCHECK_EQ(state_, STATE_START); |
| 56 result_ = ERR_IO_PENDING; | 56 result_ = ERR_IO_PENDING; |
| 57 pac_script_ = string16(); | 57 pac_script_ = string16(); |
| 58 state_ = STATE_WAIT_DHCP; | 58 state_ = STATE_WAIT_DHCP; |
| 59 callback_ = callback; | 59 callback_ = callback; |
| 60 | 60 |
| 61 wait_timer_.Start(FROM_HERE, ImplGetTimeout(), | 61 wait_timer_.Start(ImplGetTimeout(), |
| 62 this, &DhcpProxyScriptAdapterFetcher::OnTimeout); | 62 this, &DhcpProxyScriptAdapterFetcher::OnTimeout); |
| 63 worker_thread_ = ImplCreateWorkerThread(AsWeakPtr()); | 63 worker_thread_ = ImplCreateWorkerThread(AsWeakPtr()); |
| 64 worker_thread_->Start(adapter_name); | 64 worker_thread_->Start(adapter_name); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void DhcpProxyScriptAdapterFetcher::Cancel() { | 67 void DhcpProxyScriptAdapterFetcher::Cancel() { |
| 68 DCHECK(CalledOnValidThread()); | 68 DCHECK(CalledOnValidThread()); |
| 69 callback_ = NULL; | 69 callback_ = NULL; |
| 70 wait_timer_.Stop(); | 70 wait_timer_.Stop(); |
| 71 script_fetcher_.reset(); | 71 script_fetcher_.reset(); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 // Return only up to the first null in case of embedded NULLs; if the | 288 // Return only up to the first null in case of embedded NULLs; if the |
| 289 // server is giving us back a buffer with embedded NULLs, something is | 289 // server is giving us back a buffer with embedded NULLs, something is |
| 290 // broken anyway. | 290 // broken anyway. |
| 291 return std::string(reinterpret_cast<const char *>(wpad_params.Data)); | 291 return std::string(reinterpret_cast<const char *>(wpad_params.Data)); |
| 292 } | 292 } |
| 293 | 293 |
| 294 return ""; | 294 return ""; |
| 295 } | 295 } |
| 296 | 296 |
| 297 } // namespace net | 297 } // namespace net |
| OLD | NEW |