Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1233)

Unified Diff: components/safe_browsing_db/v4_database.h

Issue 1983603002: Revert of Initialize and reset V4LocalDBManager. Instantiate V4Stores. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v4_01_db_realz
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/safe_browsing_db/BUILD.gn ('k') | components/safe_browsing_db/v4_database.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d8a159197788bdf201ef0e898ff81c26c33d1537..509939e68be6366928a21ca4071958d50fb574b7 100644
--- a/components/safe_browsing_db/v4_database.h
+++ b/components/safe_browsing_db/v4_database.h
@@ -8,16 +8,12 @@
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/sequenced_task_runner.h"
-#include "base/single_thread_task_runner.h"
#include "components/safe_browsing_db/v4_protocol_manager_util.h"
#include "components/safe_browsing_db/v4_store.h"
namespace safe_browsing {
class V4Database;
-
-typedef base::Callback<void(std::unique_ptr<V4Database>)>
- NewDatabaseReadyCallback;
typedef const base::hash_map<UpdateListIdentifier,
const base::FilePath::CharType>
@@ -47,15 +43,18 @@
// The V4Database serves as a single place to manage all the V4Stores.
class V4Database {
public:
- // Factory method to create a V4Database. It creates the database on the
- // provided |db_task_runner|. When the database creation is complete, it calls
- // the NewDatabaseReadyCallback on the same thread as it was called.
- static void Create(
+ // Factory method for obtaining a V4Database implementation.
+ // It is not thread safe.
+ // The availability of each list is controlled by the one flag on this
+ // method.
+ static V4Database* Create(
const scoped_refptr<base::SequencedTaskRunner>& db_task_runner,
const base::FilePath& base_path,
- ListInfoMap list_info_map,
- NewDatabaseReadyCallback callback);
+ ListInfoMap list_info_map);
+ V4Database(
+ const scoped_refptr<base::SequencedTaskRunner>& db_task_runner,
+ StoreMap store_map);
virtual ~V4Database();
// Deletes the current database and creates a new one.
@@ -67,25 +66,7 @@
factory_ = factory;
}
- protected:
- V4Database(const scoped_refptr<base::SequencedTaskRunner>& db_task_runner,
- StoreMap store_map);
-
private:
- // Factory method to create a V4Database. When the database creation is
- // complete, it calls the NewDatabaseReadyCallback on |callback_task_runner|.
- static void CreateOnTaskRunner(
- const scoped_refptr<base::SequencedTaskRunner>& db_task_runner,
- const base::FilePath& base_path,
- ListInfoMap list_info_map,
- const scoped_refptr<base::SingleThreadTaskRunner>& callback_task_runner,
- NewDatabaseReadyCallback callback);
-
- const scoped_refptr<base::SequencedTaskRunner> db_task_runner_;
-
- // Map of UpdateListIdentifier to the V4Store.
- StoreMap store_map_;
-
// The factory that controls the creation of V4Database objects.
// This is used *only* by tests.
static V4DatabaseFactory* factory_;
« no previous file with comments | « components/safe_browsing_db/BUILD.gn ('k') | components/safe_browsing_db/v4_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698