Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(938)

Unified Diff: url/url_util.cc

Issue 2562813003: Merge logic for SameDomainOrHost for GURLs and Origins (Closed)
Patch Set: brettw review Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « url/url_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/url_util.cc
diff --git a/url/url_util.cc b/url/url_util.cc
index 0b3044dc854487cf56e99462d033c0bd671275ed..b3e360424152668e0a786883ad206734fc657366 100644
--- a/url/url_util.cc
+++ b/url/url_util.cc
@@ -538,6 +538,14 @@ bool DomainIs(base::StringPiece canonicalized_host,
return true;
}
+bool HostIsIPAddress(base::StringPiece host) {
+ url::RawCanonOutputT<char, 128> ignored_output;
+ url::CanonHostInfo host_info;
+ url::CanonicalizeIPAddress(host.data(), Component(0, host.length()),
+ &ignored_output, &host_info);
+ return host_info.IsIPAddress();
+}
+
bool Canonicalize(const char* spec,
int spec_len,
bool trim_path_end,
« no previous file with comments | « url/url_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698