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 15 matching lines...) Expand all Loading... |
26 #include "net/base/net_export.h" | 26 #include "net/base/net_export.h" |
27 #include "net/base/network_change_notifier.h" | 27 #include "net/base/network_change_notifier.h" |
28 | 28 |
29 class GURL; | 29 class GURL; |
30 | 30 |
31 namespace base { | 31 namespace base { |
32 class Time; | 32 class Time; |
33 } | 33 } |
34 | 34 |
35 namespace url { | 35 namespace url { |
| 36 class Origin; |
| 37 |
36 struct CanonHostInfo; | 38 struct CanonHostInfo; |
37 struct Parsed; | 39 struct Parsed; |
38 } | 40 } |
39 | 41 |
40 namespace net { | 42 namespace net { |
41 | 43 |
42 // Used by FormatUrl to specify handling of certain parts of the url. | 44 // Used by FormatUrl to specify handling of certain parts of the url. |
43 typedef uint32 FormatUrlType; | 45 typedef uint32 FormatUrlType; |
44 typedef uint32 FormatUrlTypes; | 46 typedef uint32 FormatUrlTypes; |
45 | 47 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 std::string::const_iterator host_and_port_end, | 94 std::string::const_iterator host_and_port_end, |
93 std::string* host, | 95 std::string* host, |
94 int* port); | 96 int* port); |
95 NET_EXPORT bool ParseHostAndPort( | 97 NET_EXPORT bool ParseHostAndPort( |
96 const std::string& host_and_port, | 98 const std::string& host_and_port, |
97 std::string* host, | 99 std::string* host, |
98 int* port); | 100 int* port); |
99 | 101 |
100 // Returns a host:port string for the given URL. | 102 // Returns a host:port string for the given URL. |
101 NET_EXPORT std::string GetHostAndPort(const GURL& url); | 103 NET_EXPORT std::string GetHostAndPort(const GURL& url); |
| 104 NET_EXPORT std::string GetHostAndPort(const url::Origin& origin); |
102 | 105 |
103 // Returns a host[:port] string for the given URL, where the port is omitted | 106 // Returns a host[:port] string for the given URL, where the port is omitted |
104 // if it is the default for the URL's scheme. | 107 // if it is the default for the URL's scheme. |
105 NET_EXPORT_PRIVATE std::string GetHostAndOptionalPort(const GURL& url); | 108 NET_EXPORT_PRIVATE std::string GetHostAndOptionalPort(const GURL& url); |
106 | 109 |
107 // Returns true if |hostname| contains a non-registerable or non-assignable | 110 // Returns true if |hostname| contains a non-registerable or non-assignable |
108 // domain name (eg: a gTLD that has not been assigned by IANA) or an IP address | 111 // domain name (eg: a gTLD that has not been assigned by IANA) or an IP address |
109 // that falls in an IANA-reserved range. | 112 // that falls in an IANA-reserved range. |
110 NET_EXPORT bool IsHostnameNonUnique(const std::string& hostname); | 113 NET_EXPORT bool IsHostnameNonUnique(const std::string& hostname); |
111 | 114 |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 DSCP_CS5 = 40, // Video | 585 DSCP_CS5 = 40, // Video |
583 DSCP_EF = 46, // Voice | 586 DSCP_EF = 46, // Voice |
584 DSCP_CS6 = 48, // Voice | 587 DSCP_CS6 = 48, // Voice |
585 DSCP_CS7 = 56, // Control messages | 588 DSCP_CS7 = 56, // Control messages |
586 DSCP_LAST = DSCP_CS7 | 589 DSCP_LAST = DSCP_CS7 |
587 }; | 590 }; |
588 | 591 |
589 } // namespace net | 592 } // namespace net |
590 | 593 |
591 #endif // NET_BASE_NET_UTIL_H_ | 594 #endif // NET_BASE_NET_UTIL_H_ |
OLD | NEW |