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

Unified Diff: chrome/browser/autocomplete/autocomplete_input.cc

Issue 15140003: Add support for split Public Suffix List distinctions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased again Created 7 years, 7 months 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 | « no previous file | chrome/browser/autocomplete/history_quick_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..06ac18a0b149ab0c6c43da2426cf649bf00c573a 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::registry_controlled_domains::GetRegistryLength(
+ UTF16ToUTF8(host),
+ net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
+ net::registry_controlled_domains::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)
+ const size_t tld_length =
+ net::registry_controlled_domains::GetRegistryLength(
+ UTF16ToUTF8(host_with_tld),
+ net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
+ net::registry_controlled_domains::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.
}
« no previous file with comments | « no previous file | chrome/browser/autocomplete/history_quick_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698