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
3 // found in the LICENSE file.
5 #include "net/proxy/dhcpcsvc_init_win.h"
7 #include "base/lazy_instance.h"
8 #include "base/logging.h"
11 #include <dhcpv6csdk.h>
15 class DhcpcsvcInitSingleton
{
17 DhcpcsvcInitSingleton() {
19 DWORD err
= DhcpCApiInitialize(&version
);
20 DCHECK(err
== ERROR_SUCCESS
); // DCHECK_EQ complains of unsigned mismatch.
23 ~DhcpcsvcInitSingleton() {
24 // Worker pool threads that use the DHCP API may still be running, so skip
29 static base::LazyInstance
<DhcpcsvcInitSingleton
> g_dhcpcsvc_init_singleton
=
30 LAZY_INSTANCE_INITIALIZER
;
36 void EnsureDhcpcsvcInit() {
37 g_dhcpcsvc_init_singleton
.Get();