| 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 "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 void ResetStores(const std::vector<ListIdentifier>& stores_to_reset); | 129 void ResetStores(const std::vector<ListIdentifier>& stores_to_reset); |
| 130 | 130 |
| 131 // Schedules verification of the checksum of each store read from disk on task | 131 // Schedules verification of the checksum of each store read from disk on task |
| 132 // runner. If the checksum doesn't match, that store is passed to the | 132 // runner. If the checksum doesn't match, that store is passed to the |
| 133 // |db_ready_for_updates_callback|. At the end, | 133 // |db_ready_for_updates_callback|. At the end, |
| 134 // |db_ready_for_updates_callback| is scheduled (on the same thread as it was | 134 // |db_ready_for_updates_callback| is scheduled (on the same thread as it was |
| 135 // called) to indicate that the database updates can now be scheduled. | 135 // called) to indicate that the database updates can now be scheduled. |
| 136 void VerifyChecksum( | 136 void VerifyChecksum( |
| 137 DatabaseReadyForUpdatesCallback db_ready_for_updates_callback); | 137 DatabaseReadyForUpdatesCallback db_ready_for_updates_callback); |
| 138 | 138 |
| 139 // Records the size of each of the stores managed by this database, along |
| 140 // with the combined size of all the stores. |
| 141 void RecordFileSizeHistograms(); |
| 142 |
| 139 protected: | 143 protected: |
| 140 V4Database(const scoped_refptr<base::SequencedTaskRunner>& db_task_runner, | 144 V4Database(const scoped_refptr<base::SequencedTaskRunner>& db_task_runner, |
| 141 std::unique_ptr<StoreMap> store_map); | 145 std::unique_ptr<StoreMap> store_map); |
| 142 | 146 |
| 143 private: | 147 private: |
| 144 friend class V4DatabaseTest; | 148 friend class V4DatabaseTest; |
| 145 FRIEND_TEST_ALL_PREFIXES(V4DatabaseTest, TestSetupDatabaseWithFakeStores); | 149 FRIEND_TEST_ALL_PREFIXES(V4DatabaseTest, TestSetupDatabaseWithFakeStores); |
| 146 FRIEND_TEST_ALL_PREFIXES(V4DatabaseTest, | 150 FRIEND_TEST_ALL_PREFIXES(V4DatabaseTest, |
| 147 TestSetupDatabaseWithFakeStoresFailsReset); | 151 TestSetupDatabaseWithFakeStoresFailsReset); |
| 148 FRIEND_TEST_ALL_PREFIXES(V4DatabaseTest, TestApplyUpdateWithNewStates); | 152 FRIEND_TEST_ALL_PREFIXES(V4DatabaseTest, TestApplyUpdateWithNewStates); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 // that needed updating and is ready for the next update. It should only be | 196 // that needed updating and is ready for the next update. It should only be |
| 193 // accessed on the IO thread. | 197 // accessed on the IO thread. |
| 194 int pending_store_updates_; | 198 int pending_store_updates_; |
| 195 | 199 |
| 196 DISALLOW_COPY_AND_ASSIGN(V4Database); | 200 DISALLOW_COPY_AND_ASSIGN(V4Database); |
| 197 }; | 201 }; |
| 198 | 202 |
| 199 } // namespace safe_browsing | 203 } // namespace safe_browsing |
| 200 | 204 |
| 201 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_ | 205 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_ |
| OLD | NEW |