| 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 607d735f3080be6b37354b5963064df6e78bd7fa..67df13044ce85dc1e5965807c6b1df86baba8eca 100644
|
| --- a/net/base/registry_controlled_domains/registry_controlled_domain.cc
|
| +++ b/net/base/registry_controlled_domains/registry_controlled_domain.cc
|
| @@ -241,20 +241,34 @@ size_t GetRegistryLength(
|
| base::StringPiece host = gurl.host_piece();
|
| if (host.empty())
|
| return std::string::npos;
|
| - if (gurl.HostIsIPAddress())
|
| - return 0;
|
| return GetRegistryLengthImpl(host, unknown_filter, private_filter);
|
| }
|
|
|
| -size_t GetRegistryLength(base::StringPiece host,
|
| - UnknownRegistryFilter unknown_filter,
|
| - PrivateRegistryFilter private_filter) {
|
| +bool HostHasRegistryControlledDomain(base::StringPiece host,
|
| + UnknownRegistryFilter unknown_filter,
|
| + PrivateRegistryFilter private_filter) {
|
| + url::CanonHostInfo host_info;
|
| + const std::string canon_host(CanonicalizeHost(host, &host_info));
|
| + if (canon_host.empty())
|
| + return false;
|
| + return GetRegistryLengthImpl(canon_host, unknown_filter, private_filter) > 0;
|
| +}
|
| +
|
| +size_t GetRegistryLengthForCanonicalHost(base::StringPiece canon_host,
|
| + UnknownRegistryFilter unknown_filter,
|
| + PrivateRegistryFilter private_filter) {
|
| + if (canon_host.empty())
|
| + return std::string::npos;
|
| + return GetRegistryLengthImpl(canon_host, unknown_filter, private_filter);
|
| +}
|
| +
|
| +size_t BuggyGetHostRegistryLength(const std::string& host,
|
| + UnknownRegistryFilter unknown_filter,
|
| + PrivateRegistryFilter private_filter) {
|
| url::CanonHostInfo host_info;
|
| const std::string canon_host(CanonicalizeHost(host, &host_info));
|
| if (canon_host.empty())
|
| return std::string::npos;
|
| - if (host_info.IsIPAddress())
|
| - return 0;
|
| return GetRegistryLengthImpl(canon_host, unknown_filter, private_filter);
|
| }
|
|
|
|
|