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

Unified Diff: components/previews/core/previews_black_list.h

Issue 2387823002: Adding ClearBlackList to the PreviewsBlackList and plumbing to UI (Closed)
Patch Set: tbansal comments 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
Index: components/previews/core/previews_black_list.h
diff --git a/components/previews/core/previews_black_list.h b/components/previews/core/previews_black_list.h
index 40b50d58788e8bb8ca5e0eeb9e8e3c5ff46aa69e..e7e9c66a8ba291fb90a271f25522b739add0b5b1 100644
--- a/components/previews/core/previews_black_list.h
+++ b/components/previews/core/previews_black_list.h
@@ -52,30 +52,39 @@ class PreviewsBlackList {
// the backing store. If the in memory map has reached the max number of hosts
// allowed, and |url| is a new host, a host will be evicted based on recency
// of the hosts most recent opt out.
void AddPreviewNavigation(const GURL& url, bool opt_out, PreviewsType type);
// Synchronously determines if |host_name| should be allowed to show previews.
// If the black list has loaded yet, this will always return false. |type| is
// not used to make this decision.
bool IsLoadedAndAllowed(const GURL& url, PreviewsType type) const;
+ // Asynchronously deletes all entries in the in-memory black list. Informs
+ // the backing store to delete entries between |begin_time| and |end_time|,
+ // and reloads entries into memory from the backing store. If the embedder
+ // passed in a null store, resets all history in the in-memory black list.
+ void ClearBlackList(base::Time begin_time, base::Time end_time);
+
private:
// Synchronous version of AddPreviewNavigation method.
void AddPreviewNavigationSync(const GURL& host_name,
bool opt_out,
PreviewsType type);
// Returns the PreviewsBlackListItem representing |host_name|. If there is no
// item for |host_name|, returns null.
PreviewsBlackListItem* GetBlackListItem(const std::string& host_name) const;
+ // Synchronous version of ClearBlackList method.
+ void ClearBlackListSync(base::Time begin_time, base::Time end_time);
+
// Returns a new PreviewsBlackListItem representing |host_name|. Adds the new
// item to the in-memory map.
PreviewsBlackListItem* CreateBlackListItem(const std::string& host_name);
// Callback passed to the backing store when loading black list information.
// Moves the returned map into the in-memory black list and runs any
// outstanding tasks.
void LoadBlackListDone(std::unique_ptr<BlackListItemMap> black_list_item_map);
// Called while waiting for the black list to be loaded from the backing
« no previous file with comments | « chrome/browser/previews/previews_service_factory.cc ('k') | components/previews/core/previews_black_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698