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 // This file contains a set of utility functions related to parsing, | 5 // This file contains a set of utility functions related to parsing, |
6 // manipulating, and interacting with URLs and hostnames. These functions are | 6 // manipulating, and interacting with URLs and hostnames. These functions are |
7 // intended to be of a text-processing nature, and should not attempt to use any | 7 // intended to be of a text-processing nature, and should not attempt to use any |
8 // networking or blocking services. | 8 // networking or blocking services. |
9 | 9 |
10 #ifndef NET_BASE_URL_UTIL_H_ | 10 #ifndef NET_BASE_URL_UTIL_H_ |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 // for histograms and shouldn't be used to affect behavior. | 165 // for histograms and shouldn't be used to affect behavior. |
166 NET_EXPORT_PRIVATE bool HasGoogleHost(const GURL& url); | 166 NET_EXPORT_PRIVATE bool HasGoogleHost(const GURL& url); |
167 | 167 |
168 // This function tests |host| to see if it is of any local hostname form. | 168 // This function tests |host| to see if it is of any local hostname form. |
169 // |host| is normalized before being tested and if |is_local6| is not NULL then | 169 // |host| is normalized before being tested and if |is_local6| is not NULL then |
170 // it it will be set to true if the localhost name implies an IPv6 interface ( | 170 // it it will be set to true if the localhost name implies an IPv6 interface ( |
171 // for instance localhost6.localdomain6). | 171 // for instance localhost6.localdomain6). |
172 NET_EXPORT_PRIVATE bool IsLocalHostname(base::StringPiece host, | 172 NET_EXPORT_PRIVATE bool IsLocalHostname(base::StringPiece host, |
173 bool* is_local6); | 173 bool* is_local6); |
174 | 174 |
| 175 // Returns true if the |domain| matches the given |host| as described in |
| 176 // section 5.1.3 of RFC 6265. |
| 177 NET_EXPORT_PRIVATE bool IsDomainMatch(const std::string& domain, |
| 178 const std::string& host); |
| 179 |
175 } // namespace net | 180 } // namespace net |
176 | 181 |
177 #endif // NET_BASE_URL_UTIL_H_ | 182 #endif // NET_BASE_URL_UTIL_H_ |
OLD | NEW |