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

Unified Diff: chrome/browser/android/history_report/delta_file_commons.cc

Issue 2456643005: Reduce buggy usage of the registry controlled domain service. (Closed)
Patch Set: Fix Created 4 years, 2 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/supervised_user/supervised_user_url_filter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/history_report/delta_file_commons.cc
diff --git a/chrome/browser/android/history_report/delta_file_commons.cc b/chrome/browser/android/history_report/delta_file_commons.cc
index 183fb200b7146a0c8b3fead22bece4288b8ad29c..8b6789ac91641610e9338a4d210634bc3e63e658 100644
--- a/chrome/browser/android/history_report/delta_file_commons.cc
+++ b/chrome/browser/android/history_report/delta_file_commons.cc
@@ -16,7 +16,7 @@
using bookmarks::BookmarkModel;
using net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES;
using net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES;
-using net::registry_controlled_domains::GetRegistryLength;
+using net::registry_controlled_domains::GetCanonicalHostRegistryLength;
namespace {
@@ -26,11 +26,11 @@ const int kSHA256ByteSize = 32;
const size_t kUrlLengthLimit = 20 * 1024 * 1024; // 20M
const size_t kUrlLengthWidth = 8;
-void StripTopLevelDomain(std::string* host) {
- size_t registry_length = GetRegistryLength(
- *host, EXCLUDE_UNKNOWN_REGISTRIES, EXCLUDE_PRIVATE_REGISTRIES);
+void StripTopLevelDomain(std::string* canonical_host) {
+ size_t registry_length = GetCanonicalHostRegistryLength(
+ *canonical_host, EXCLUDE_UNKNOWN_REGISTRIES, EXCLUDE_PRIVATE_REGISTRIES);
if (registry_length != 0 && registry_length != std::string::npos)
- host->erase(host->length() - (registry_length + 1));
+ canonical_host->erase(canonical_host->length() - (registry_length + 1));
}
void StripCommonSubDomains(std::string* host) {
« no previous file with comments | « no previous file | chrome/browser/supervised_user/supervised_user_url_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698