Index: url/url_util.h |
diff --git a/url/url_util.h b/url/url_util.h |
index a209a61c76029bed62f70c471e53bbfedd848332..baae84a400fe7ca52c68c3f24112d0f543341d83 100644 |
--- a/url/url_util.h |
+++ b/url/url_util.h |
@@ -8,6 +8,7 @@ |
#include <string> |
#include "base/strings/string16.h" |
+#include "base/strings/string_piece.h" |
#include "url/third_party/mozilla/url_parse.h" |
#include "url/url_canon.h" |
#include "url/url_constants.h" |
@@ -217,6 +218,16 @@ URL_EXPORT void EncodeURIComponent(const char* input, |
int length, |
CanonOutput* output); |
+// 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.
|
+// the given |lower_ascii_domain| string. For example, if the canonicalized |
+// hostname is "www.google.com", this will return true for "com", "google.com", |
+// and "www.google.com" domains. |
+// |
+// The input domain should be a non-empty lower-case ASCII string to match the |
+// canonicalized host. The host should be non-empty as well. |
+URL_EXPORT bool DomainIs(base::StringPiece canonicalized_host, |
+ base::StringPiece lower_ascii_domain); |
+ |
} // namespace url |
#endif // URL_URL_UTIL_H_ |