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

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

Issue 2439203002: Adding a short blacklist period after every previews opt out (Closed)
Patch Set: tbansal commetns 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 | components/previews/core/previews_black_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2bfe91e31aec109edc12cb7f126e40fe0109f92e..a1e36cc9033a2eb1b403f9cc71dee1e72a1e3508 100644
--- a/components/previews/core/previews_black_list.h
+++ b/components/previews/core/previews_black_list.h
@@ -8,21 +8,23 @@
#include <stdint.h>
#include <memory>
#include <queue>
#include <string>
#include <vector>
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "base/optional.h"
#include "base/threading/thread_checker.h"
+#include "base/time/time.h"
#include "components/previews/core/previews_experiments.h"
#include "components/previews/core/previews_opt_out_store.h"
class GURL;
namespace base {
class Clock;
}
namespace previews {
@@ -97,20 +99,23 @@ class PreviewsBlackList {
// 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_;
// Whether the black list is done being loaded from the backing store.
bool loaded_;
+ // The time of the last opt out for this session.
+ base::Optional<base::Time> last_opt_out_time_;
+
// 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_;
std::unique_ptr<base::Clock> clock_;
base::ThreadChecker thread_checker_;
« no previous file with comments | « no previous file | components/previews/core/previews_black_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698