Chromium Code Reviews| 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 #ifndef NET_BASE_NET_UTIL_H_ | 5 #ifndef NET_BASE_NET_UTIL_H_ |
| 6 #define NET_BASE_NET_UTIL_H_ | 6 #define NET_BASE_NET_UTIL_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 std::string* host, | 104 std::string* host, |
| 105 int* port); | 105 int* port); |
| 106 | 106 |
| 107 // Returns a host:port string for the given URL. | 107 // Returns a host:port string for the given URL. |
| 108 NET_EXPORT std::string GetHostAndPort(const GURL& url); | 108 NET_EXPORT std::string GetHostAndPort(const GURL& url); |
| 109 | 109 |
| 110 // Returns a host[:port] string for the given URL, where the port is omitted | 110 // Returns a host[:port] string for the given URL, where the port is omitted |
| 111 // if it is the default for the URL's scheme. | 111 // if it is the default for the URL's scheme. |
| 112 NET_EXPORT_PRIVATE std::string GetHostAndOptionalPort(const GURL& url); | 112 NET_EXPORT_PRIVATE std::string GetHostAndOptionalPort(const GURL& url); |
| 113 | 113 |
| 114 // Returns true if |hostname| contains a name that is non-unique among | |
| 115 // certificates (eg: an "internal server name"). | |
|
Ryan Sleevi
2013/08/01 21:37:55
nit: Probably need to update this comment to remov
felt
2013/08/01 22:00:25
Most of the comment is in the implementation file
| |
| 116 // | |
| 117 // While such names are not scheduled to be deprecated until 1 November 2015 | |
| 118 // according to the CA/Browser Forum Baseline Requirements (v1.1), they | |
| 119 // represent a real risk for the deployment of new gTLDs, and thus being | |
| 120 // phased out ahead of the hard deadline. | |
| 121 // TODO(rsleevi): http://crbug.com/119212 - Also match internal IP address | |
| 122 // ranges. | |
| 123 NET_EXPORT bool IsHostnameNonUnique(const std::string& hostname); | |
| 124 | |
| 114 // Convenience struct for when you need a |struct sockaddr|. | 125 // Convenience struct for when you need a |struct sockaddr|. |
| 115 struct SockaddrStorage { | 126 struct SockaddrStorage { |
| 116 SockaddrStorage() : addr_len(sizeof(addr_storage)), | 127 SockaddrStorage() : addr_len(sizeof(addr_storage)), |
| 117 addr(reinterpret_cast<struct sockaddr*>(&addr_storage)) {} | 128 addr(reinterpret_cast<struct sockaddr*>(&addr_storage)) {} |
| 118 struct sockaddr_storage addr_storage; | 129 struct sockaddr_storage addr_storage; |
| 119 socklen_t addr_len; | 130 socklen_t addr_len; |
| 120 struct sockaddr* const addr; | 131 struct sockaddr* const addr; |
| 121 }; | 132 }; |
| 122 | 133 |
| 123 // Extracts the IP address and port portions of a sockaddr. |port| is optional, | 134 // Extracts the IP address and port portions of a sockaddr. |port| is optional, |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 526 WIFI_PHY_LAYER_PROTOCOL_UNKNOWN | 537 WIFI_PHY_LAYER_PROTOCOL_UNKNOWN |
| 527 }; | 538 }; |
| 528 | 539 |
| 529 // Characterize the PHY mode of the currently associated access point. | 540 // Characterize the PHY mode of the currently associated access point. |
| 530 // Currently only available on OS_WIN. | 541 // Currently only available on OS_WIN. |
| 531 NET_EXPORT WifiPHYLayerProtocol GetWifiPHYLayerProtocol(); | 542 NET_EXPORT WifiPHYLayerProtocol GetWifiPHYLayerProtocol(); |
| 532 | 543 |
| 533 } // namespace net | 544 } // namespace net |
| 534 | 545 |
| 535 #endif // NET_BASE_NET_UTIL_H_ | 546 #endif // NET_BASE_NET_UTIL_H_ |
| OLD | NEW |