| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 NewDatabaseReadyCallback callback); | 61 NewDatabaseReadyCallback callback); |
| 62 | 62 |
| 63 // Destroys the provided v4_database on its task_runner since this may be a | 63 // Destroys the provided v4_database on its task_runner since this may be a |
| 64 // long operation. | 64 // long operation. |
| 65 static void Destroy(std::unique_ptr<V4Database> v4_database); | 65 static void Destroy(std::unique_ptr<V4Database> v4_database); |
| 66 | 66 |
| 67 virtual ~V4Database(); | 67 virtual ~V4Database(); |
| 68 | 68 |
| 69 // Updates the stores with the response received from the SafeBrowsing service | 69 // Updates the stores with the response received from the SafeBrowsing service |
| 70 // and calls the db_updated_callback when done. | 70 // and calls the db_updated_callback when done. |
| 71 void ApplyUpdate(const std::vector<ListUpdateResponse>& response, | 71 void ApplyUpdate(std::unique_ptr<ParsedServerResponse> parsed_server_response, |
| 72 DatabaseUpdatedCallback db_updated_callback); | 72 DatabaseUpdatedCallback db_updated_callback); |
| 73 | 73 |
| 74 // Returns the current state of each of the stores being managed. | 74 // Returns the current state of each of the stores being managed. |
| 75 std::unique_ptr<StoreStateMap> GetStoreStateMap(); | 75 std::unique_ptr<StoreStateMap> GetStoreStateMap(); |
| 76 | 76 |
| 77 // Deletes the current database and creates a new one. | 77 // Deletes the current database and creates a new one. |
| 78 virtual bool ResetDatabase(); | 78 virtual bool ResetDatabase(); |
| 79 | 79 |
| 80 protected: | 80 protected: |
| 81 V4Database(const scoped_refptr<base::SequencedTaskRunner>& db_task_runner, | 81 V4Database(const scoped_refptr<base::SequencedTaskRunner>& db_task_runner, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 // that needed updating and is ready for the next update. It should only be | 130 // that needed updating and is ready for the next update. It should only be |
| 131 // accessed on the IO thread. | 131 // accessed on the IO thread. |
| 132 int pending_store_updates_; | 132 int pending_store_updates_; |
| 133 | 133 |
| 134 DISALLOW_COPY_AND_ASSIGN(V4Database); | 134 DISALLOW_COPY_AND_ASSIGN(V4Database); |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 } // namespace safe_browsing | 137 } // namespace safe_browsing |
| 138 | 138 |
| 139 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_ | 139 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_ |
| OLD | NEW |