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 7bd575302df3d7c9531c494e9c5dcd47ddd8cc39..0aee34021d1c54bd7e075484238756d8441e4999 100644 |
--- a/components/previews/core/previews_black_list.h |
+++ b/components/previews/core/previews_black_list.h |
@@ -60,53 +60,56 @@ class PreviewsBlackList { |
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); |
// Returns a new PreviewsBlackListItem representing |host_name|. Adds the new |
// item to |black_list_item_map|. |
- static PreviewsBlackListItem* GetOrCreateBlackListItem( |
+ static PreviewsBlackListItem* GetOrCreateBlackListItemForMap( |
BlackListItemMap* black_list_item_map, |
const std::string& host_name); |
- // Returns the PreviewsBlackListItem representing |host_name| in |
- // |black_list_item_map|. If there is no item for |host_name|, returns null. |
- static PreviewsBlackListItem* GetBlackListItem( |
- const BlackListItemMap& black_list_item_map, |
- const std::string& host_name); |
+ // Returns a new PreviewsBlackListItem for the general black list that does |
tbansal1
2016/10/21 22:56:26
"general" is very vague. Can you use a more specif
RyanSturm
2016/10/24 22:24:40
Done.
|
+ // not consider host name. |
+ static std::unique_ptr<PreviewsBlackListItem> CreateGeneralBlackListItem(); |
private: |
// Synchronous version of AddPreviewNavigation method. |
void AddPreviewNavigationSync(const GURL& host_name, |
bool opt_out, |
PreviewsType type); |
// Synchronous version of ClearBlackList method. |
void ClearBlackListSync(base::Time begin_time, base::Time end_time); |
// 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); |
+ // Moves the |black_list_item_map| and |general_black_list_item| into the |
+ // in-memory black list and runs any outstanding tasks. |
+ void LoadBlackListDone( |
+ std::unique_ptr<BlackListItemMap> black_list_item_map, |
+ std::unique_ptr<PreviewsBlackListItem> general_black_list_item); |
// Called while waiting for the black list to be loaded from the backing |
// store. |
// Enqueues a task to run when when loading black list information has |
// completed. Maintains the order that tasks were called in. |
void QueuePendingTask(base::Closure callback); |
// Map maintaining the in-memory black list. |
std::unique_ptr<BlackListItemMap> black_list_item_map_; |
+ // General opt out history not based on host. |
+ std::unique_ptr<PreviewsBlackListItem> general_black_list_item_; |
+ |
// Whether the black list is done being loaded from the backing store. |
bool loaded_; |
// The backing store of the black list information. |
std::unique_ptr<PreviewsOptOutStore> opt_out_store_; |
// Callbacks to be run after loading information from the backing store has |
// completed. |
std::queue<base::Closure> pending_callbacks_; |