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_LOCAL_DATABASE_MANAGER_H_ | 5 #ifndef COMPONENTS_SAFE_BROWSING_DB_V4_LOCAL_DATABASE_MANAGER_H_ |
6 #define COMPONENTS_SAFE_BROWSING_DB_V4_LOCAL_DATABASE_MANAGER_H_ | 6 #define COMPONENTS_SAFE_BROWSING_DB_V4_LOCAL_DATABASE_MANAGER_H_ |
7 | 7 |
8 // A class that provides the interface between the SafeBrowsing protocol manager | 8 // A class that provides the interface between the SafeBrowsing protocol manager |
9 // and database that holds the downloaded updates. | 9 // and database that holds the downloaded updates. |
10 | 10 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 FRIEND_TEST_ALL_PREFIXES(V4LocalDatabaseManagerTest, | 127 FRIEND_TEST_ALL_PREFIXES(V4LocalDatabaseManagerTest, |
128 TestGetSeverestThreatTypeAndMetadata); | 128 TestGetSeverestThreatTypeAndMetadata); |
129 | 129 |
130 // The set of clients awaiting a full hash response. It is used for tracking | 130 // The set of clients awaiting a full hash response. It is used for tracking |
131 // which clients have cancelled their outstanding request. | 131 // which clients have cancelled their outstanding request. |
132 typedef std::unordered_set<Client*> PendingClients; | 132 typedef std::unordered_set<Client*> PendingClients; |
133 | 133 |
134 ~V4LocalDatabaseManager() override; | 134 ~V4LocalDatabaseManager() override; |
135 | 135 |
136 // Called when all the stores managed by the database have been read from | 136 // Called when all the stores managed by the database have been read from |
137 // disk after startup and the database is ready for use. | 137 // disk after startup and the database is ready for checking resource |
138 void DatabaseReady(std::unique_ptr<V4Database> v4_database); | 138 // reputation. |
| 139 void DatabaseReadyForChecks(std::unique_ptr<V4Database> v4_database); |
| 140 |
| 141 // Called when all the stores managed by the database have been verified for |
| 142 // checksum correctness after startup and the database is ready for applying |
| 143 // updates. |
| 144 void DatabaseReadyForUpdates( |
| 145 const std::vector<ListIdentifier>& stores_to_reset); |
139 | 146 |
140 // Called when the database has been updated and schedules the next update. | 147 // Called when the database has been updated and schedules the next update. |
141 void DatabaseUpdated(); | 148 void DatabaseUpdated(); |
142 | 149 |
143 // Return the prefixes and the store they matched in, for a given URL. Returns | 150 // Return the prefixes and the store they matched in, for a given URL. Returns |
144 // true if a hash prefix match is found; false otherwise. | 151 // true if a hash prefix match is found; false otherwise. |
145 bool GetPrefixMatches( | 152 bool GetPrefixMatches( |
146 const std::unique_ptr<PendingCheck>& check, | 153 const std::unique_ptr<PendingCheck>& check, |
147 FullHashToStoreAndHashPrefixesMap* full_hash_to_store_and_hash_prefixes); | 154 FullHashToStoreAndHashPrefixesMap* full_hash_to_store_and_hash_prefixes); |
148 | 155 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 // The protocol manager that downloads the hash prefix updates. | 234 // The protocol manager that downloads the hash prefix updates. |
228 std::unique_ptr<V4UpdateProtocolManager> v4_update_protocol_manager_; | 235 std::unique_ptr<V4UpdateProtocolManager> v4_update_protocol_manager_; |
229 | 236 |
230 friend class base::RefCountedThreadSafe<V4LocalDatabaseManager>; | 237 friend class base::RefCountedThreadSafe<V4LocalDatabaseManager>; |
231 DISALLOW_COPY_AND_ASSIGN(V4LocalDatabaseManager); | 238 DISALLOW_COPY_AND_ASSIGN(V4LocalDatabaseManager); |
232 }; // class V4LocalDatabaseManager | 239 }; // class V4LocalDatabaseManager |
233 | 240 |
234 } // namespace safe_browsing | 241 } // namespace safe_browsing |
235 | 242 |
236 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_LOCAL_DATABASE_MANAGER_H_ | 243 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_LOCAL_DATABASE_MANAGER_H_ |
OLD | NEW |