OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_URL_UTIL_H_ | 5 #ifndef NET_BASE_URL_UTIL_H_ |
6 #define NET_BASE_URL_UTIL_H_ | 6 #define NET_BASE_URL_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // The rules are: | 125 // The rules are: |
126 // * One or more components separated by '.' | 126 // * One or more components separated by '.' |
127 // * Each component contains only alphanumeric characters and '-' or '_' | 127 // * Each component contains only alphanumeric characters and '-' or '_' |
128 // * The last component begins with an alphanumeric character | 128 // * The last component begins with an alphanumeric character |
129 // * Optional trailing dot after last component (means "treat as FQDN") | 129 // * Optional trailing dot after last component (means "treat as FQDN") |
130 // | 130 // |
131 // NOTE: You should only pass in hosts that have been returned from | 131 // NOTE: You should only pass in hosts that have been returned from |
132 // CanonicalizeHost(), or you may not get accurate results. | 132 // CanonicalizeHost(), or you may not get accurate results. |
133 NET_EXPORT bool IsCanonicalizedHostCompliant(const std::string& host); | 133 NET_EXPORT bool IsCanonicalizedHostCompliant(const std::string& host); |
134 | 134 |
| 135 // Returns true if |hostname| contains a non-registerable or non-assignable |
| 136 // domain name (eg: a gTLD that has not been assigned by IANA) or an IP address |
| 137 // that falls in an IANA-reserved range. |
| 138 NET_EXPORT bool IsHostnameNonUnique(const std::string& hostname); |
| 139 |
135 // Strip the portions of |url| that aren't core to the network request. | 140 // Strip the portions of |url| that aren't core to the network request. |
136 // - user name / password | 141 // - user name / password |
137 // - reference section | 142 // - reference section |
138 NET_EXPORT GURL SimplifyUrlForRequest(const GURL& url); | 143 NET_EXPORT GURL SimplifyUrlForRequest(const GURL& url); |
139 | 144 |
140 // Extracts the unescaped username/password from |url|, saving the results | 145 // Extracts the unescaped username/password from |url|, saving the results |
141 // into |*username| and |*password|. | 146 // into |*username| and |*password|. |
142 NET_EXPORT_PRIVATE void GetIdentityFromURL(const GURL& url, | 147 NET_EXPORT_PRIVATE void GetIdentityFromURL(const GURL& url, |
143 base::string16* username, | 148 base::string16* username, |
144 base::string16* password); | 149 base::string16* password); |
145 | 150 |
146 // Returns true if the url's host is a Google server. This should only be used | 151 // Returns true if the url's host is a Google server. This should only be used |
147 // for histograms and shouldn't be used to affect behavior. | 152 // for histograms and shouldn't be used to affect behavior. |
148 NET_EXPORT_PRIVATE bool HasGoogleHost(const GURL& url); | 153 NET_EXPORT_PRIVATE bool HasGoogleHost(const GURL& url); |
149 | 154 |
150 } // namespace net | 155 } // namespace net |
151 | 156 |
152 #endif // NET_BASE_URL_UTIL_H_ | 157 #endif // NET_BASE_URL_UTIL_H_ |
OLD | NEW |