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/base/net_util.h" | 5 #include "net/base/net_util.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <limits> | 10 #include <limits> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 | 14 |
15 #if defined(OS_WIN) | 15 #if defined(OS_WIN) |
16 #include <windows.h> | 16 #include <windows.h> |
17 #include <iphlpapi.h> | 17 #include <iphlpapi.h> |
18 #include <winsock2.h> | 18 #include <winsock2.h> |
19 #include <ws2bth.h> | 19 #include <ws2bth.h> |
20 #pragma comment(lib, "iphlpapi.lib") | 20 #pragma comment(lib, "iphlpapi.lib") |
21 #elif defined(OS_POSIX) | 21 #elif defined(OS_POSIX) |
22 #include <fcntl.h> | 22 #include <fcntl.h> |
23 #include <netdb.h> | 23 #include <netdb.h> |
24 #include <unistd.h> | 24 #include <unistd.h> |
25 #endif // defined(OS_POSIX) | 25 #endif // defined(OS_POSIX) |
26 | 26 |
27 #include "base/basictypes.h" | |
28 #include "base/json/string_escape.h" | 27 #include "base/json/string_escape.h" |
29 #include "base/logging.h" | 28 #include "base/logging.h" |
30 #include "base/strings/string_split.h" | 29 #include "base/strings/string_split.h" |
31 #include "base/strings/string_util.h" | 30 #include "base/strings/string_util.h" |
32 #include "base/strings/stringprintf.h" | 31 #include "base/strings/stringprintf.h" |
33 #include "base/strings/utf_string_conversions.h" | 32 #include "base/strings/utf_string_conversions.h" |
34 #include "base/sys_byteorder.h" | 33 #include "base/sys_byteorder.h" |
35 #include "base/values.h" | 34 #include "base/values.h" |
36 #include "net/base/address_list.h" | 35 #include "net/base/address_list.h" |
37 #include "net/base/escape.h" | 36 #include "net/base/escape.h" |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 // Here it's possible to get away with faster case-sensitive comparisons | 512 // Here it's possible to get away with faster case-sensitive comparisons |
514 // because the list above is all lowercase, and a GURL's host name will | 513 // because the list above is all lowercase, and a GURL's host name will |
515 // always be canonicalized to lowercase as well. | 514 // always be canonicalized to lowercase as well. |
516 if (base::EndsWith(host, suffix, base::CompareCase::SENSITIVE)) | 515 if (base::EndsWith(host, suffix, base::CompareCase::SENSITIVE)) |
517 return true; | 516 return true; |
518 } | 517 } |
519 return false; | 518 return false; |
520 } | 519 } |
521 | 520 |
522 } // namespace net | 521 } // namespace net |
OLD | NEW |