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

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

Issue 2390773003: Adding a SQL implementation of the backing store for previews opt outs (Closed)
Patch Set: Split black list initialization and construction 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.cc
diff --git a/components/previews/core/previews_black_list.cc b/components/previews/core/previews_black_list.cc
index f4b277b6f231ee0f0e6b4dca36c274bd30b29f94..e991130c5cedb37555281246d93c16fa3c0a2752 100644
--- a/components/previews/core/previews_black_list.cc
+++ b/components/previews/core/previews_black_list.cc
@@ -14,31 +14,33 @@
#include "url/gurl.h"
namespace previews {
PreviewsBlackList::PreviewsBlackList(
std::unique_ptr<PreviewsOptOutStore> opt_out_store,
std::unique_ptr<base::Clock> clock)
: loaded_(false),
opt_out_store_(std::move(opt_out_store)),
clock_(std::move(clock)),
- weak_factory_(this) {
+ weak_factory_(this) {}
+
+PreviewsBlackList::~PreviewsBlackList() {}
+
+void PreviewsBlackList::Initialize() {
tbansal1 2016/10/04 15:01:21 Add thread checker.
RyanSturm 2016/10/04 19:10:23 I'm undoing this. It doesn't actually help anythin
if (opt_out_store_) {
opt_out_store_->LoadBlackList(base::Bind(
&PreviewsBlackList::LoadBlackListDone, weak_factory_.GetWeakPtr()));
} else {
LoadBlackListDone(base::MakeUnique<BlackListItemMap>());
}
}
-PreviewsBlackList::~PreviewsBlackList() {}
-
void PreviewsBlackList::AddPreviewNavigation(const GURL& url,
bool opt_out,
PreviewsType type) {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(url.has_host());
// If the |black_list_item_map_| has been loaded from |opt_out_store_|,
// synchronous operations will be accurate. Otherwise, queue the task to run
// asynchronously.
if (loaded_) {
AddPreviewNavigationSync(url, opt_out, type);

Powered by Google App Engine
This is Rietveld 408576698