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_SAFE_BROWSING_DB_V4_DATABASE_H_ | 5 #ifndef COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_ |
6 #define COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_ | 6 #define COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <unordered_map> | 10 #include <unordered_map> |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 // This method updates the store_map_ to point to the new store, which causes | 202 // This method updates the store_map_ to point to the new store, which causes |
203 // the old store to get deleted. | 203 // the old store to get deleted. |
204 void UpdatedStoreReady(ListIdentifier identifier, | 204 void UpdatedStoreReady(ListIdentifier identifier, |
205 std::unique_ptr<V4Store> store); | 205 std::unique_ptr<V4Store> store); |
206 | 206 |
207 // See |VerifyChecksum|. | 207 // See |VerifyChecksum|. |
208 void VerifyChecksumOnTaskRunner( | 208 void VerifyChecksumOnTaskRunner( |
209 const scoped_refptr<base::SingleThreadTaskRunner>& callback_task_runner, | 209 const scoped_refptr<base::SingleThreadTaskRunner>& callback_task_runner, |
210 DatabaseReadyForUpdatesCallback db_ready_for_updates_callback); | 210 DatabaseReadyForUpdatesCallback db_ready_for_updates_callback); |
211 | 211 |
| 212 bool IsStoreAvailable(const ListIdentifier& identifier) const; |
| 213 |
212 const scoped_refptr<base::SequencedTaskRunner> db_task_runner_; | 214 const scoped_refptr<base::SequencedTaskRunner> db_task_runner_; |
213 | 215 |
214 DatabaseUpdatedCallback db_updated_callback_; | 216 DatabaseUpdatedCallback db_updated_callback_; |
215 | 217 |
216 // The number of stores for which the update request is pending. When this | 218 // The number of stores for which the update request is pending. When this |
217 // goes down to 0, that indicates that the database has updated all the stores | 219 // goes down to 0, that indicates that the database has updated all the stores |
218 // that needed updating and is ready for the next update. It should only be | 220 // that needed updating and is ready for the next update. It should only be |
219 // accessed on the IO thread. | 221 // accessed on the IO thread. |
220 int pending_store_updates_; | 222 int pending_store_updates_; |
221 | 223 |
222 // Only meant to be dereferenced and invalidated on the IO thread and hence | 224 // Only meant to be dereferenced and invalidated on the IO thread and hence |
223 // named. For details, see the comment at the top of weak_ptr.h | 225 // named. For details, see the comment at the top of weak_ptr.h |
224 base::WeakPtrFactory<V4Database> weak_factory_on_io_; | 226 base::WeakPtrFactory<V4Database> weak_factory_on_io_; |
225 | 227 |
226 DISALLOW_COPY_AND_ASSIGN(V4Database); | 228 DISALLOW_COPY_AND_ASSIGN(V4Database); |
227 }; | 229 }; |
228 | 230 |
229 } // namespace safe_browsing | 231 } // namespace safe_browsing |
230 | 232 |
231 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_ | 233 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_ |
OLD | NEW |