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

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 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 7bd575302df3d7c9531c494e9c5dcd47ddd8cc39..ff3d4cc7006146d7851586b3b041efc9619a711a 100644
--- a/components/previews/core/previews_black_list.h
+++ b/components/previews/core/previews_black_list.h
@@ -8,20 +8,21 @@
#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 "components/previews/core/previews_opt_out_store.h"
class GURL;
namespace base {
class Clock;
tbansal1 2016/10/25 00:47:41 #include "base/time/time.h" and remove this. (oth
RyanSturm 2016/10/25 17:15:38 I definitely need base/time/time.h, but I also nee
}
namespace previews {
@@ -96,20 +97,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') | components/previews/core/previews_black_list.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698