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

Side by Side Diff: components/previews/core/previews_black_list.h

Issue 2563493002: Disallow showing offline previews on a reload. (Closed)
Patch Set: testing Created 4 years 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_PREVIEWS_CORE_PREVIEWS_BLACK_LIST_H_ 5 #ifndef COMPONENTS_PREVIEWS_CORE_PREVIEWS_BLACK_LIST_H_
6 #define COMPONENTS_PREVIEWS_CORE_PREVIEWS_BLACK_LIST_H_ 6 #define COMPONENTS_PREVIEWS_CORE_PREVIEWS_BLACK_LIST_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // The user has opted out of previews often, and is no longer shown previews 42 // The user has opted out of previews often, and is no longer shown previews
43 // on any host. 43 // on any host.
44 USER_BLACKLISTED = 4, 44 USER_BLACKLISTED = 4,
45 // The user has opted out of previews on a specific host often, and was not 45 // The user has opted out of previews on a specific host often, and was not
46 // not shown a previews on that host. 46 // not shown a previews on that host.
47 HOST_BLACKLISTED = 5, 47 HOST_BLACKLISTED = 5,
48 // The network quality estimate is not available. 48 // The network quality estimate is not available.
49 NETWORK_QUALITY_UNAVAILABLE = 6, 49 NETWORK_QUALITY_UNAVAILABLE = 6,
50 // The network was fast enough to not warrant previews. 50 // The network was fast enough to not warrant previews.
51 NETWORK_NOT_SLOW = 7, 51 NETWORK_NOT_SLOW = 7,
52 LAST = 8, 52 // If the page was reloaded, the user should not be shown an offline preview.
tbansal1 2016/12/12 19:52:21 Should the user be shown the offline page if they
RyanSturm 2016/12/12 22:42:15 This isn't the offline pages so much as offline pr
53 RELOAD_DISALLOWED_FOR_OFFLINE = 8,
54 LAST = 9,
53 }; 55 };
54 56
55 // Manages the state of black listed domains for the previews experiment. Loads 57 // Manages the state of black listed domains for the previews experiment. Loads
56 // the stored black list from |opt_out_store| and manages an in memory black 58 // the stored black list from |opt_out_store| and manages an in memory black
57 // list on the IO thread. Updates to the black list are stored in memory and 59 // list on the IO thread. Updates to the black list are stored in memory and
58 // pushed to the store. Asynchronous modifications are stored in a queue and 60 // pushed to the store. Asynchronous modifications are stored in a queue and
59 // executed in order. Reading from the black list is always synchronous, and if 61 // executed in order. Reading from the black list is always synchronous, and if
60 // the black list is not currently loaded (e.g., at startup, after clearing 62 // the black list is not currently loaded (e.g., at startup, after clearing
61 // browsing history), domains are reported as black listed. The list stores no 63 // browsing history), domains are reported as black listed. The list stores no
62 // more than previews::params::MaxInMemoryHostsInBlackList hosts in-memory, 64 // more than previews::params::MaxInMemoryHostsInBlackList hosts in-memory,
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 base::ThreadChecker thread_checker_; 150 base::ThreadChecker thread_checker_;
149 151
150 base::WeakPtrFactory<PreviewsBlackList> weak_factory_; 152 base::WeakPtrFactory<PreviewsBlackList> weak_factory_;
151 153
152 DISALLOW_COPY_AND_ASSIGN(PreviewsBlackList); 154 DISALLOW_COPY_AND_ASSIGN(PreviewsBlackList);
153 }; 155 };
154 156
155 } // namespace previews 157 } // namespace previews
156 158
157 #endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_BLACK_LIST_H_ 159 #endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_BLACK_LIST_H_
OLDNEW
« no previous file with comments | « no previous file | components/previews/core/previews_io_data.cc » ('j') | components/previews/core/previews_io_data.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698