| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 #include "base/path_service.h" | 41 #include "base/path_service.h" |
| 42 #include "base/stl_util.h" | 42 #include "base/stl_util.h" |
| 43 #include "base/string_number_conversions.h" | 43 #include "base/string_number_conversions.h" |
| 44 #include "base/string_piece.h" | 44 #include "base/string_piece.h" |
| 45 #include "base/string_split.h" | 45 #include "base/string_split.h" |
| 46 #include "base/string_tokenizer.h" | 46 #include "base/string_tokenizer.h" |
| 47 #include "base/string_util.h" | 47 #include "base/string_util.h" |
| 48 #include "base/stringprintf.h" | 48 #include "base/stringprintf.h" |
| 49 #include "base/synchronization/lock.h" | 49 #include "base/synchronization/lock.h" |
| 50 #include "base/sys_string_conversions.h" | 50 #include "base/sys_string_conversions.h" |
| 51 #include "base/sys_byteorder.h" |
| 51 #include "base/time.h" | 52 #include "base/time.h" |
| 52 #include "base/utf_offset_string_conversions.h" | 53 #include "base/utf_offset_string_conversions.h" |
| 53 #include "base/utf_string_conversions.h" | 54 #include "base/utf_string_conversions.h" |
| 54 #include "googleurl/src/gurl.h" | 55 #include "googleurl/src/gurl.h" |
| 55 #include "googleurl/src/url_canon.h" | 56 #include "googleurl/src/url_canon.h" |
| 56 #include "googleurl/src/url_canon_ip.h" | 57 #include "googleurl/src/url_canon_ip.h" |
| 57 #include "googleurl/src/url_parse.h" | 58 #include "googleurl/src/url_parse.h" |
| 58 #include "grit/net_resources.h" | 59 #include "grit/net_resources.h" |
| 59 #include "net/base/dns_util.h" | 60 #include "net/base/dns_util.h" |
| 60 #include "net/base/escape.h" | 61 #include "net/base/escape.h" |
| 61 #include "net/base/mime_util.h" | 62 #include "net/base/mime_util.h" |
| 62 #include "net/base/net_module.h" | 63 #include "net/base/net_module.h" |
| 63 #if defined(OS_WIN) | 64 #if defined(OS_WIN) |
| 64 #include "net/base/winsock_init.h" | 65 #include "net/base/winsock_init.h" |
| 65 #endif | 66 #endif |
| 66 #include "net/http/http_content_disposition.h" | 67 #include "net/http/http_content_disposition.h" |
| 67 #include "unicode/datefmt.h" | 68 #include "unicode/datefmt.h" |
| 68 #include "unicode/regex.h" | 69 #include "unicode/regex.h" |
| 69 #include "unicode/ucnv.h" | 70 #include "unicode/ucnv.h" |
| 70 #include "unicode/uidna.h" | 71 #include "unicode/uidna.h" |
| 71 #include "unicode/ulocdata.h" | 72 #include "unicode/ulocdata.h" |
| 72 #include "unicode/uniset.h" | 73 #include "unicode/uniset.h" |
| 73 #include "unicode/uscript.h" | 74 #include "unicode/uscript.h" |
| 74 #include "unicode/uset.h" | 75 #include "unicode/uset.h" |
| 75 | 76 |
| 76 using base::Time; | 77 using base::Time; |
| 77 | 78 |
| 79 #if defined(OS_WIN) |
| 80 // Allow htons/ntohs to be called without requiring ws2_32.dll to be loaded, |
| 81 // which isn't available in Chrome's sandbox. See crbug.com/116591. |
| 82 #define ntohs(x) _byteswap_ushort(x) |
| 83 #define htons(x) _byteswap_ushort(x) |
| 84 #endif // OS_WIN |
| 85 |
| 78 namespace net { | 86 namespace net { |
| 79 | 87 |
| 80 namespace { | 88 namespace { |
| 81 | 89 |
| 82 // what we prepend to get a file URL | 90 // what we prepend to get a file URL |
| 83 static const FilePath::CharType kFileURLPrefix[] = | 91 static const FilePath::CharType kFileURLPrefix[] = |
| 84 FILE_PATH_LITERAL("file:///"); | 92 FILE_PATH_LITERAL("file:///"); |
| 85 | 93 |
| 86 // The general list of blocked ports. Will be blocked unless a specific | 94 // The general list of blocked ports. Will be blocked unless a specific |
| 87 // protocol overrides it. (Ex: ftp can use ports 20 and 21) | 95 // protocol overrides it. (Ex: ftp can use ports 20 and 21) |
| (...skipping 2315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2403 | 2411 |
| 2404 NetworkInterface::NetworkInterface(const std::string& name, | 2412 NetworkInterface::NetworkInterface(const std::string& name, |
| 2405 const IPAddressNumber& address) | 2413 const IPAddressNumber& address) |
| 2406 : name(name), address(address) { | 2414 : name(name), address(address) { |
| 2407 } | 2415 } |
| 2408 | 2416 |
| 2409 NetworkInterface::~NetworkInterface() { | 2417 NetworkInterface::~NetworkInterface() { |
| 2410 } | 2418 } |
| 2411 | 2419 |
| 2412 } // namespace net | 2420 } // namespace net |
| OLD | NEW |