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

Side by Side Diff: components/previews/previews_opt_out_store.h

Issue 2335023002: Adding a previews IO-thread blacklist (Closed)
Patch Set: tbansal comments Created 4 years, 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_PREVIEWS_PREVIEWS_OPT_OUT_STORE_H_
6 #define COMPONENTS_PREVIEWS_PREVIEWS_OPT_OUT_STORE_H_
7
8 #include <stdint.h>
9
10 #include <vector>
11
12 #include "base/callback.h"
13 #include "components/previews/previews_black_list_item.h"
14
15 class GURL;
16
17 namespace base {
18 class Time;
19 }
20
21 namespace previews {
22
23 enum class PreviewsType {
24 NONE = 0,
25 OFFLINE = 1,
26 LAST = 2,
27 };
28
29 typedef base::Callback<void(std::unique_ptr<BlackListItemMap>)>
30 LoadBlackListCallback;
31
32 // PreviewsOptOutStore keeps opt out information for the previews.
33 // Ability to create multiple instances of the store as well as behavior of
34 // asynchronous operations when the object is being destroyed, before such
35 // operation finishes will depend on implementation. It should be possible to
36 // issue multiple asynchronous operations in parallel and maintain ordering.
37 class PreviewsOptOutStore {
38 public:
39 PreviewsOptOutStore();
40 virtual ~PreviewsOptOutStore();
41
42 // Adds a new navigation to the store. |opt_out| is whether the uesr opted out
43 // of the preview or navigated away from the page by another way.
44 virtual void AddPreviewNavigation(bool opt_out,
45 const std::string& host_name,
46 PreviewsType type,
47 const base::Time& now) = 0;
48
49 // Asynchronously loads a map of host names to PreviewsBlackListItem for that
50 // host from the store.
51 virtual void LoadBlackList(LoadBlackListCallback callback) = 0;
52
53 };
54
55 } // namespace previews
56
57 #endif // COMPONENTS_PREVIEWS_PREVIEWS_OPT_OUT_STORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698