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/address_sorter_posix.h" | 5 #include "net/dns/address_sorter_posix.h" |
6 | 6 |
7 #include <netinet/in.h> | 7 #include <netinet/in.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #if defined(OS_MACOSX) || defined(OS_BSD) | 12 #if defined(OS_MACOSX) || defined(OS_BSD) |
13 #include <sys/socket.h> // Must be included before ifaddrs.h. | 13 #include <sys/socket.h> // Must be included before ifaddrs.h. |
14 #include <ifaddrs.h> | 14 #include <ifaddrs.h> |
15 #include <net/if.h> | 15 #include <net/if.h> |
16 #include <netinet/in_var.h> | 16 #include <netinet/in_var.h> |
17 #include <string.h> | 17 #include <string.h> |
18 #include <sys/ioctl.h> | 18 #include <sys/ioctl.h> |
19 #endif | 19 #endif |
20 | 20 |
21 #include <algorithm> | 21 #include <algorithm> |
22 #include <vector> | 22 #include <vector> |
23 | 23 |
24 #include "base/logging.h" | 24 #include "base/logging.h" |
25 #include "net/base/net_errors.h" | 25 #include "net/base/net_errors.h" |
26 #include "net/log/net_log_source.h" | 26 #include "net/log/net_log_source.h" |
27 #include "net/socket/client_socket_factory.h" | 27 #include "net/socket/client_socket_factory.h" |
28 #include "net/udp/datagram_client_socket.h" | 28 #include "net/socket/datagram_client_socket.h" |
29 | 29 |
30 #if defined(OS_LINUX) | 30 #if defined(OS_LINUX) |
31 #include "net/base/address_tracker_linux.h" | 31 #include "net/base/address_tracker_linux.h" |
32 #endif | 32 #endif |
33 | 33 |
34 namespace net { | 34 namespace net { |
35 | 35 |
36 namespace { | 36 namespace { |
37 | 37 |
38 // Address sorting is performed according to RFC3484 with revisions. | 38 // Address sorting is performed according to RFC3484 with revisions. |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 } | 391 } |
392 | 392 |
393 // static | 393 // static |
394 std::unique_ptr<AddressSorter> AddressSorter::CreateAddressSorter() { | 394 std::unique_ptr<AddressSorter> AddressSorter::CreateAddressSorter() { |
395 return std::unique_ptr<AddressSorter>( | 395 return std::unique_ptr<AddressSorter>( |
396 new AddressSorterPosix(ClientSocketFactory::GetDefaultFactory())); | 396 new AddressSorterPosix(ClientSocketFactory::GetDefaultFactory())); |
397 } | 397 } |
398 | 398 |
399 } // namespace net | 399 } // namespace net |
400 | 400 |
OLD | NEW |