Chromium Code Reviews| Index: chrome/browser/autocomplete/autocomplete_input.cc |
| diff --git a/chrome/browser/autocomplete/autocomplete_input.cc b/chrome/browser/autocomplete/autocomplete_input.cc |
| index f6c039ce01eb77aeaff7c9e38c92d72b80f3db7e..13ad7537cad36c84ec24da2ee4ee73ffbda54f8d 100644 |
| --- a/chrome/browser/autocomplete/autocomplete_input.cc |
| +++ b/chrome/browser/autocomplete/autocomplete_input.cc |
| @@ -266,8 +266,10 @@ AutocompleteInput::Type AutocompleteInput::Parse( |
| // use the registry length later below.) |
| const string16 host(text.substr(parts->host.begin, parts->host.len)); |
| const size_t registry_length = |
| - net::RegistryControlledDomainService::GetRegistryLength(UTF16ToUTF8(host), |
| - false); |
| + net::RegistryControlledDomainService::GetRegistryLength( |
| + UTF16ToUTF8(host), |
| + net::RCDS::EXCLUDE_UNKNOWN_REGISTRIES, |
| + net::RCDS::EXCLUDE_PRIVATE_REGISTRIES); |
| if (registry_length == std::string::npos) { |
| // Try to append the desired_tld. |
| if (!desired_tld.empty()) { |
| @@ -275,8 +277,12 @@ AutocompleteInput::Type AutocompleteInput::Parse( |
| if (host[host.length() - 1] != '.') |
| host_with_tld += '.'; |
| host_with_tld += desired_tld; |
| - if (net::RegistryControlledDomainService::GetRegistryLength( |
| - UTF16ToUTF8(host_with_tld), false) != std::string::npos) |
| + size_t tld_length = |
|
sky
2013/04/26 20:02:27
const
Pam (message me for reviews)
2013/04/29 09:25:56
Interesting. It's clear what that does, but it's n
sky
2013/04/29 16:08:30
http://www.corp.google.com/eng/doc/cppguide.xml#Us
|
| + net::RegistryControlledDomainService::GetRegistryLength( |
| + UTF16ToUTF8(host_with_tld), |
| + net::RCDS::EXCLUDE_UNKNOWN_REGISTRIES, |
| + net::RCDS::EXCLUDE_PRIVATE_REGISTRIES); |
| + if (tld_length != std::string::npos) |
| return URL; // Something like "99999999999" that looks like a bad IP |
| // address, but becomes valid on attaching a TLD. |
| } |