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 URL_URL_UTIL_H_ | 5 #ifndef URL_URL_UTIL_H_ |
6 #define URL_URL_UTIL_H_ | 6 #define URL_URL_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 #include "base/strings/string_piece.h" | |
11 #include "url/third_party/mozilla/url_parse.h" | 12 #include "url/third_party/mozilla/url_parse.h" |
12 #include "url/url_canon.h" | 13 #include "url/url_canon.h" |
13 #include "url/url_constants.h" | 14 #include "url/url_constants.h" |
14 #include "url/url_export.h" | 15 #include "url/url_export.h" |
15 | 16 |
16 namespace url { | 17 namespace url { |
17 | 18 |
18 // Init ------------------------------------------------------------------------ | 19 // Init ------------------------------------------------------------------------ |
19 | 20 |
20 // Initialization is NOT required, it will be implicitly initialized when first | 21 // Initialization is NOT required, it will be implicitly initialized when first |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
210 URL_EXPORT void DecodeURLEscapeSequences(const char* input, | 211 URL_EXPORT void DecodeURLEscapeSequences(const char* input, |
211 int length, | 212 int length, |
212 CanonOutputW* output); | 213 CanonOutputW* output); |
213 | 214 |
214 // Escapes the given string as defined by the JS method encodeURIComponent. See | 215 // Escapes the given string as defined by the JS method encodeURIComponent. See |
215 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/encodeUR IComponent | 216 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/encodeUR IComponent |
216 URL_EXPORT void EncodeURIComponent(const char* input, | 217 URL_EXPORT void EncodeURIComponent(const char* input, |
217 int length, | 218 int length, |
218 CanonOutput* output); | 219 CanonOutput* output); |
219 | 220 |
221 // Returns true if the |canonicalized_host| matches or is in the same domain as | |
engedy
2016/08/26 16:48:14
I'd argue this should go into a new section before
pkalinnikov
2016/08/29 09:53:00
Done.
| |
222 // the given |lower_ascii_domain| string. For example, if the canonicalized | |
223 // hostname is "www.google.com", this will return true for "com", "google.com", | |
224 // and "www.google.com" domains. | |
225 // | |
226 // The input domain should be a non-empty lower-case ASCII string to match the | |
227 // canonicalized host. The host should be non-empty as well. | |
228 URL_EXPORT bool DomainIs(base::StringPiece canonicalized_host, | |
229 base::StringPiece lower_ascii_domain); | |
230 | |
220 } // namespace url | 231 } // namespace url |
221 | 232 |
222 #endif // URL_URL_UTIL_H_ | 233 #endif // URL_URL_UTIL_H_ |
OLD | NEW |