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/dns/dns_config_service_win.h" | 5 #include "net/dns/dns_config_service_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 bool ReadDevolutionSetting(const RegistryReader& reader, | 322 bool ReadDevolutionSetting(const RegistryReader& reader, |
323 DnsSystemSettings::DevolutionSetting& setting) { | 323 DnsSystemSettings::DevolutionSetting& setting) { |
324 return reader.ReadDword(L"UseDomainNameDevolution", &setting.enabled) && | 324 return reader.ReadDword(L"UseDomainNameDevolution", &setting.enabled) && |
325 reader.ReadDword(L"DomainNameDevolutionLevel", &setting.level); | 325 reader.ReadDword(L"DomainNameDevolutionLevel", &setting.level); |
326 } | 326 } |
327 | 327 |
328 virtual void DoWork() OVERRIDE { | 328 virtual void DoWork() OVERRIDE { |
329 // Should be called on WorkerPool. | 329 // Should be called on WorkerPool. |
330 success_ = false; | 330 success_ = false; |
331 | 331 |
332 DnsSystemSettings settings; | 332 DnsSystemSettings settings = {}; |
333 memset(&settings, 0, sizeof(settings)); | |
334 settings.addresses = ReadIpHelper(GAA_FLAG_SKIP_ANYCAST | | 333 settings.addresses = ReadIpHelper(GAA_FLAG_SKIP_ANYCAST | |
335 GAA_FLAG_SKIP_UNICAST | | 334 GAA_FLAG_SKIP_UNICAST | |
336 GAA_FLAG_SKIP_MULTICAST | | 335 GAA_FLAG_SKIP_MULTICAST | |
337 GAA_FLAG_SKIP_FRIENDLY_NAME); | 336 GAA_FLAG_SKIP_FRIENDLY_NAME); |
338 if (!settings.addresses.get()) | 337 if (!settings.addresses.get()) |
339 return; // no point reading the rest | 338 return; // no point reading the rest |
340 | 339 |
341 RegistryReader tcpip_reader(kTcpipPath); | 340 RegistryReader tcpip_reader(kTcpipPath); |
342 RegistryReader tcpip6_reader(kTcpip6Path); | 341 RegistryReader tcpip6_reader(kTcpip6Path); |
343 RegistryReader dnscache_reader(kDnscachePath); | 342 RegistryReader dnscache_reader(kDnscachePath); |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 | 549 |
551 } // namespace internal | 550 } // namespace internal |
552 | 551 |
553 // static | 552 // static |
554 scoped_ptr<DnsConfigService> DnsConfigService::CreateSystemService() { | 553 scoped_ptr<DnsConfigService> DnsConfigService::CreateSystemService() { |
555 return scoped_ptr<DnsConfigService>(new internal::DnsConfigServiceWin()); | 554 return scoped_ptr<DnsConfigService>(new internal::DnsConfigServiceWin()); |
556 } | 555 } |
557 | 556 |
558 } // namespace net | 557 } // namespace net |
559 | 558 |
OLD | NEW |