Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: net/dns/dns_config_service_win.cc

Issue 10545065: [net/dns] Don't use memset to initialize a struct with string16 members. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698