| 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/dhcp_proxy_script_fetcher_win.h" | 5 #include "net/proxy/dhcp_proxy_script_fetcher_win.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/memory/free_deleter.h" | 11 #include "base/memory/free_deleter.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/profiler/scoped_tracker.h" | 13 #include "base/profiler/scoped_tracker.h" |
| 14 #include "base/threading/sequenced_worker_pool.h" | 14 #include "base/threading/sequenced_worker_pool.h" |
| 15 #include "net/base/net_errors.h" | 15 #include "net/base/net_errors.h" |
| 16 #include "net/proxy/dhcp_proxy_script_adapter_fetcher_win.h" | 16 #include "net/proxy/dhcp_proxy_script_adapter_fetcher_win.h" |
| 17 | 17 |
| 18 #include <winsock2.h> | 18 #include <winsock2.h> |
| 19 #include <iphlpapi.h> | 19 #include <iphlpapi.h> |
| 20 #pragma comment(lib, "iphlpapi.lib") | |
| 21 | 20 |
| 22 namespace { | 21 namespace { |
| 23 | 22 |
| 24 // How many threads to use at maximum to do DHCP lookups. This is | 23 // How many threads to use at maximum to do DHCP lookups. This is |
| 25 // chosen based on the following UMA data: | 24 // chosen based on the following UMA data: |
| 26 // - When OnWaitTimer fires, ~99.8% of users have 6 or fewer network | 25 // - When OnWaitTimer fires, ~99.8% of users have 6 or fewer network |
| 27 // adapters enabled for DHCP in total. | 26 // adapters enabled for DHCP in total. |
| 28 // - At the same measurement point, ~99.7% of users have 3 or fewer pending | 27 // - At the same measurement point, ~99.7% of users have 3 or fewer pending |
| 29 // DHCP adapter lookups. | 28 // DHCP adapter lookups. |
| 30 // - There is however a very long and thin tail of users who have | 29 // - There is however a very long and thin tail of users who have |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 | 374 |
| 376 bool DhcpProxyScriptFetcherWin::AdapterQuery::ImplGetCandidateAdapterNames( | 375 bool DhcpProxyScriptFetcherWin::AdapterQuery::ImplGetCandidateAdapterNames( |
| 377 std::set<std::string>* adapter_names) { | 376 std::set<std::string>* adapter_names) { |
| 378 return DhcpProxyScriptFetcherWin::GetCandidateAdapterNames(adapter_names); | 377 return DhcpProxyScriptFetcherWin::GetCandidateAdapterNames(adapter_names); |
| 379 } | 378 } |
| 380 | 379 |
| 381 DhcpProxyScriptFetcherWin::AdapterQuery::~AdapterQuery() { | 380 DhcpProxyScriptFetcherWin::AdapterQuery::~AdapterQuery() { |
| 382 } | 381 } |
| 383 | 382 |
| 384 } // namespace net | 383 } // namespace net |
| OLD | NEW |