| Index: net/base/registry_controlled_domains/registry_controlled_domain.cc
|
| diff --git a/net/base/registry_controlled_domains/registry_controlled_domain.cc b/net/base/registry_controlled_domains/registry_controlled_domain.cc
|
| index ca367f7214297509d21ea2f3e0bb8284e2ef855a..48e95508664313e955fbd585c6d673b07d47f119 100644
|
| --- a/net/base/registry_controlled_domains/registry_controlled_domain.cc
|
| +++ b/net/base/registry_controlled_domains/registry_controlled_domain.cc
|
| @@ -202,6 +202,16 @@ std::string GetDomainAndRegistry(base::StringPiece host,
|
| return GetDomainAndRegistryImpl(canon_host, filter).as_string();
|
| }
|
|
|
| +bool SameHost(const GURL& gurl1, const GURL& gurl2) {
|
| + const url::Component host1 = gurl1.parsed_for_possibly_invalid_spec().host;
|
| + const url::Component host2 = gurl2.parsed_for_possibly_invalid_spec().host;
|
| + if ((host1.len <= 0) || (host1.len != host2.len))
|
| + return false;
|
| + return !strncmp(gurl1.possibly_invalid_spec().data() + host1.begin,
|
| + gurl2.possibly_invalid_spec().data() + host2.begin,
|
| + host1.len);
|
| +}
|
| +
|
| bool SameDomainOrHost(
|
| const GURL& gurl1,
|
| const GURL& gurl2,
|
| @@ -216,13 +226,7 @@ bool SameDomainOrHost(
|
| return domain1 == domain2;
|
|
|
| // No domains. See if the hosts are identical.
|
| - const url::Component host1 = gurl1.parsed_for_possibly_invalid_spec().host;
|
| - const url::Component host2 = gurl2.parsed_for_possibly_invalid_spec().host;
|
| - if ((host1.len <= 0) || (host1.len != host2.len))
|
| - return false;
|
| - return !strncmp(gurl1.possibly_invalid_spec().data() + host1.begin,
|
| - gurl2.possibly_invalid_spec().data() + host2.begin,
|
| - host1.len);
|
| + return SameHost(gurl1, gurl2);
|
| }
|
|
|
| bool SameDomainOrHost(const url::Origin& origin1,
|
|
|