Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 // Enqueues a task to run when when loading black list information has | 96 // Enqueues a task to run when when loading black list information has |
| 97 // completed. Maintains the order that tasks were called in. | 97 // completed. Maintains the order that tasks were called in. |
| 98 void QueuePendingTask(base::Closure callback); | 98 void QueuePendingTask(base::Closure callback); |
| 99 | 99 |
| 100 // Map maintaining the in-memory black list. | 100 // Map maintaining the in-memory black list. |
| 101 std::unique_ptr<BlackListItemMap> black_list_item_map_; | 101 std::unique_ptr<BlackListItemMap> black_list_item_map_; |
| 102 | 102 |
| 103 // Whether the black list is done being loaded from the backing store. | 103 // Whether the black list is done being loaded from the backing store. |
| 104 bool loaded_; | 104 bool loaded_; |
| 105 | 105 |
| 106 // The time of the last opt out for this session. | |
| 107 base::Optional<base::Time> last_opt_out_time_; | |
|
tbansal1
2016/10/21 23:15:33
#include base/optional.h
RyanSturm
2016/10/24 21:18:25
Done.
| |
| 108 | |
| 106 // The backing store of the black list information. | 109 // The backing store of the black list information. |
| 107 std::unique_ptr<PreviewsOptOutStore> opt_out_store_; | 110 std::unique_ptr<PreviewsOptOutStore> opt_out_store_; |
| 108 | 111 |
| 109 // Callbacks to be run after loading information from the backing store has | 112 // Callbacks to be run after loading information from the backing store has |
| 110 // completed. | 113 // completed. |
| 111 std::queue<base::Closure> pending_callbacks_; | 114 std::queue<base::Closure> pending_callbacks_; |
| 112 | 115 |
| 113 std::unique_ptr<base::Clock> clock_; | 116 std::unique_ptr<base::Clock> clock_; |
| 114 | 117 |
| 115 base::ThreadChecker thread_checker_; | 118 base::ThreadChecker thread_checker_; |
| 116 | 119 |
| 117 base::WeakPtrFactory<PreviewsBlackList> weak_factory_; | 120 base::WeakPtrFactory<PreviewsBlackList> weak_factory_; |
| 118 | 121 |
| 119 DISALLOW_COPY_AND_ASSIGN(PreviewsBlackList); | 122 DISALLOW_COPY_AND_ASSIGN(PreviewsBlackList); |
| 120 }; | 123 }; |
| 121 | 124 |
| 122 } // namespace previews | 125 } // namespace previews |
| 123 | 126 |
| 124 #endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_BLACK_LIST_H_ | 127 #endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_BLACK_LIST_H_ |
| OLD | NEW |