| Index: components/safe_browsing_db/v4_database.h
|
| diff --git a/components/safe_browsing_db/v4_database.h b/components/safe_browsing_db/v4_database.h
|
| index 15fa61fe0e7d8b04f2ff5b5dd85ea517fc78862d..cc07d4e308a8be28944a2ba2e84e0d7eaae50fde 100644
|
| --- a/components/safe_browsing_db/v4_database.h
|
| +++ b/components/safe_browsing_db/v4_database.h
|
| @@ -78,9 +78,10 @@
|
| class V4DatabaseFactory {
|
| public:
|
| virtual ~V4DatabaseFactory() {}
|
| - virtual std::unique_ptr<V4Database> Create(
|
| + virtual V4Database* CreateV4Database(
|
| const scoped_refptr<base::SequencedTaskRunner>& db_task_runner,
|
| - std::unique_ptr<StoreMap> store_map);
|
| + const base::FilePath& base_dir_path,
|
| + const ListInfos& list_infos) = 0;
|
| };
|
|
|
| // The on-disk databases are shared among all profiles, as it doesn't contain
|
| @@ -100,17 +101,11 @@
|
| const scoped_refptr<base::SequencedTaskRunner>& db_task_runner,
|
| const base::FilePath& base_path,
|
| const ListInfos& list_infos,
|
| - NewDatabaseReadyCallback new_db_callback);
|
| + NewDatabaseReadyCallback callback);
|
|
|
| // Destroys the provided v4_database on its task_runner since this may be a
|
| // long operation.
|
| static void Destroy(std::unique_ptr<V4Database> v4_database);
|
| -
|
| - // Makes the passed |factory| the factory used to instantiate a V4Database.
|
| - // Only for tests.
|
| - static void RegisterFactory(std::unique_ptr<V4DatabaseFactory> factory) {
|
| - db_factory_ = std::move(factory);
|
| - }
|
|
|
| virtual ~V4Database();
|
|
|
| @@ -158,7 +153,6 @@
|
| std::unique_ptr<StoreMap> store_map);
|
|
|
| private:
|
| - friend class V4DatabaseFactory;
|
| friend class V4DatabaseTest;
|
| FRIEND_TEST_ALL_PREFIXES(V4DatabaseTest, TestSetupDatabaseWithFakeStores);
|
| FRIEND_TEST_ALL_PREFIXES(V4DatabaseTest,
|
| @@ -171,9 +165,8 @@
|
|
|
| // Makes the passed |factory| the factory used to instantiate a V4Store. Only
|
| // for tests.
|
| - static void RegisterStoreFactoryForTest(
|
| - std::unique_ptr<V4StoreFactory> factory) {
|
| - store_factory_ = std::move(factory);
|
| + static void RegisterStoreFactoryForTest(V4StoreFactory* factory) {
|
| + factory_ = factory;
|
| }
|
|
|
| // Factory method to create a V4Database. When the database creation is
|
| @@ -197,20 +190,15 @@
|
| const scoped_refptr<base::SingleThreadTaskRunner>& callback_task_runner,
|
| DatabaseReadyForUpdatesCallback db_ready_for_updates_callback);
|
|
|
| - protected:
|
| + const scoped_refptr<base::SequencedTaskRunner> db_task_runner_;
|
| +
|
| // Map of ListIdentifier to the V4Store.
|
| const std::unique_ptr<StoreMap> store_map_;
|
|
|
| - private:
|
| - const scoped_refptr<base::SequencedTaskRunner> db_task_runner_;
|
| -
|
| DatabaseUpdatedCallback db_updated_callback_;
|
|
|
| - // The factory that controls the creation of the V4Database object.
|
| - static std::unique_ptr<V4DatabaseFactory> db_factory_;
|
| -
|
| // The factory that controls the creation of V4Store objects.
|
| - static std::unique_ptr<V4StoreFactory> store_factory_;
|
| + static V4StoreFactory* factory_;
|
|
|
| // The number of stores for which the update request is pending. When this
|
| // goes down to 0, that indicates that the database has updated all the stores
|
|
|