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

Unified Diff: components/history/core/browser/history_backend.cc

Issue 1924773002: TopSites: filter out non-WebSafe URLs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@topsites_cleanup
Patch Set: comment Created 4 years, 8 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
Index: components/history/core/browser/history_backend.cc
diff --git a/components/history/core/browser/history_backend.cc b/components/history/core/browser/history_backend.cc
index 6307b3eae9fd3eb74b35c14ebd66b4f174fe4a65..4b767f84164c03b15202c80d925d2b73b180f523 100644
--- a/components/history/core/browser/history_backend.cc
+++ b/components/history/core/browser/history_backend.cc
@@ -1356,8 +1356,13 @@ void HistoryBackend::QueryMostVisitedURLs(int result_count,
if (!db_)
return;
+ auto url_filter = backend_client_
+ ? base::Bind(&HistoryBackendClient::IsWebSafe,
+ base::Unretained(backend_client_.get()))
+ : base::Callback<bool(const GURL&)>();
std::vector<std::unique_ptr<PageUsageData>> data = db_->QuerySegmentUsage(
- base::Time::Now() - base::TimeDelta::FromDays(days_back), result_count);
+ base::Time::Now() - base::TimeDelta::FromDays(days_back), result_count,
+ url_filter);
for (const std::unique_ptr<PageUsageData>& current_data : data) {
RedirectList redirects;
« no previous file with comments | « chrome/browser/history/chrome_history_backend_client.cc ('k') | components/history/core/browser/history_backend_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698