| 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_fetcher_win.h" | 5 #include "net/proxy/dhcp_proxy_script_fetcher_win.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/perftimer.h" | 8 #include "base/perftimer.h" |
| 9 #include "base/threading/worker_pool.h" | 9 #include "base/threading/worker_pool.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 } | 162 } |
| 163 if (!did_finish || result != ERR_PAC_NOT_IN_DHCP) { | 163 if (!did_finish || result != ERR_PAC_NOT_IN_DHCP) { |
| 164 break; | 164 break; |
| 165 } | 165 } |
| 166 } | 166 } |
| 167 | 167 |
| 168 // Once we have a single result, we set a maximum on how long to wait | 168 // Once we have a single result, we set a maximum on how long to wait |
| 169 // for the rest of the results. | 169 // for the rest of the results. |
| 170 if (state_ == STATE_NO_RESULTS) { | 170 if (state_ == STATE_NO_RESULTS) { |
| 171 state_ = STATE_SOME_RESULTS; | 171 state_ = STATE_SOME_RESULTS; |
| 172 wait_timer_.Start(FROM_HERE, | 172 wait_timer_.Start( |
| 173 base::TimeDelta::FromMilliseconds(ImplGetMaxWaitMs()), | 173 base::TimeDelta::FromMilliseconds(ImplGetMaxWaitMs()), |
| 174 this, &DhcpProxyScriptFetcherWin::OnWaitTimer); | 174 this, &DhcpProxyScriptFetcherWin::OnWaitTimer); |
| 175 } | 175 } |
| 176 } | 176 } |
| 177 | 177 |
| 178 void DhcpProxyScriptFetcherWin::OnWaitTimer() { | 178 void DhcpProxyScriptFetcherWin::OnWaitTimer() { |
| 179 DCHECK_EQ(state_, STATE_SOME_RESULTS); | 179 DCHECK_EQ(state_, STATE_SOME_RESULTS); |
| 180 | 180 |
| 181 // These are intended to help us understand whether our timeout may | 181 // These are intended to help us understand whether our timeout may |
| 182 // be too aggressive or not aggressive enough. | 182 // be too aggressive or not aggressive enough. |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 owner_ = owner; | 373 owner_ = owner; |
| 374 origin_loop_ = base::MessageLoopProxy::current(); | 374 origin_loop_ = base::MessageLoopProxy::current(); |
| 375 } | 375 } |
| 376 | 376 |
| 377 bool DhcpProxyScriptFetcherWin::WorkerThread::ImplGetCandidateAdapterNames( | 377 bool DhcpProxyScriptFetcherWin::WorkerThread::ImplGetCandidateAdapterNames( |
| 378 std::set<std::string>* adapter_names) { | 378 std::set<std::string>* adapter_names) { |
| 379 return DhcpProxyScriptFetcherWin::GetCandidateAdapterNames(adapter_names); | 379 return DhcpProxyScriptFetcherWin::GetCandidateAdapterNames(adapter_names); |
| 380 } | 380 } |
| 381 | 381 |
| 382 } // namespace net | 382 } // namespace net |
| OLD | NEW |