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

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

Issue 11528012: [net] Make IPEndPoint::GetFamily() return AddressFamily and add GetSockAddrFamily() to be used when… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update uses of GetFamily in net/dns/ Created 8 years 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 | « net/dns/address_sorter_win.cc ('k') | net/ftp/ftp_network_transaction.cc » ('j') | 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 255
256 for (const IP_ADAPTER_UNICAST_ADDRESS* address = 256 for (const IP_ADAPTER_UNICAST_ADDRESS* address =
257 adapter->FirstUnicastAddress; 257 adapter->FirstUnicastAddress;
258 address != NULL; 258 address != NULL;
259 address = address->Next) { 259 address = address->Next) {
260 IPEndPoint ipe; 260 IPEndPoint ipe;
261 if (!ipe.FromSockAddr(address->Address.lpSockaddr, 261 if (!ipe.FromSockAddr(address->Address.lpSockaddr,
262 address->Address.iSockaddrLength)) { 262 address->Address.iSockaddrLength)) {
263 return HOSTS_PARSE_WIN_BAD_ADDRESS; 263 return HOSTS_PARSE_WIN_BAD_ADDRESS;
264 } 264 }
265 if (!have_ipv4 && (ipe.GetFamily() == AF_INET)) { 265 if (!have_ipv4 && (ipe.GetFamily() == ADDRESS_FAMILY_IPV4)) {
266 have_ipv4 = true; 266 have_ipv4 = true;
267 (*hosts)[DnsHostsKey(localname, ADDRESS_FAMILY_IPV4)] = ipe.address(); 267 (*hosts)[DnsHostsKey(localname, ADDRESS_FAMILY_IPV4)] = ipe.address();
268 } else if (!have_ipv6 && (ipe.GetFamily() == AF_INET6)) { 268 } else if (!have_ipv6 && (ipe.GetFamily() == ADDRESS_FAMILY_IPV6)) {
269 have_ipv6 = true; 269 have_ipv6 = true;
270 (*hosts)[DnsHostsKey(localname, ADDRESS_FAMILY_IPV6)] = ipe.address(); 270 (*hosts)[DnsHostsKey(localname, ADDRESS_FAMILY_IPV6)] = ipe.address();
271 } 271 }
272 } 272 }
273 } 273 }
274 return HOSTS_PARSE_WIN_OK; 274 return HOSTS_PARSE_WIN_OK;
275 } 275 }
276 276
277 // Watches a single registry key for changes. 277 // Watches a single registry key for changes.
278 class RegistryWatcher : public base::win::ObjectWatcher::Delegate, 278 class RegistryWatcher : public base::win::ObjectWatcher::Delegate,
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 } 696 }
697 697
698 } // namespace internal 698 } // namespace internal
699 699
700 // static 700 // static
701 scoped_ptr<DnsConfigService> DnsConfigService::CreateSystemService() { 701 scoped_ptr<DnsConfigService> DnsConfigService::CreateSystemService() {
702 return scoped_ptr<DnsConfigService>(new internal::DnsConfigServiceWin()); 702 return scoped_ptr<DnsConfigService>(new internal::DnsConfigServiceWin());
703 } 703 }
704 704
705 } // namespace net 705 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/address_sorter_win.cc ('k') | net/ftp/ftp_network_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698