Index: components/safe_browsing_db/v4_database.cc |
diff --git a/components/safe_browsing_db/v4_database.cc b/components/safe_browsing_db/v4_database.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0d8ea5bbde26795bc9871a02e5df8a9eadefd9a1 |
--- /dev/null |
+++ b/components/safe_browsing_db/v4_database.cc |
@@ -0,0 +1,51 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "components/safe_browsing_db/v4_database.h" |
+ |
+namespace safe_browsing { |
+ |
+V4Database* V4DatabaseFactory::CreateV4Database( |
+ const scoped_refptr<base::SequencedTaskRunner>& db_task_runner, |
+ const base::FilePath& base_path, |
+ ListInfoMap list_suffix_map) { |
vakh (use Gerrit instead)
2016/05/06 00:41:36
This should be list_info_map -- I have fixed it in
|
+ StoreMap store_map; |
+ |
+ // TODO(vakh): Populate the store_map using list_suffix_map. |
+ |
+ return new V4Database(db_task_runner, std::move(store_map)); |
+} |
+ |
+// static |
+// Factory method, should be called on the Safe Browsing sequenced task runner, |
+// which is also passed to the function as |db_task_runner|. |
+V4Database* V4Database::Create( |
+ V4DatabaseFactory* factory, |
+ const scoped_refptr<base::SequencedTaskRunner>& db_task_runner, |
+ const base::FilePath& base_path, |
+ ListInfoMap list_info_map) { |
+ DCHECK(factory); |
+ DCHECK(db_task_runner->RunsTasksOnCurrentThread()); |
+ if (factory) { |
+ return factory->CreateV4Database(db_task_runner, base_path, |
+ list_info_map); |
+ } else { |
+ return nullptr; |
+ } |
+} |
+ |
+V4Database::V4Database( |
+ const scoped_refptr<base::SequencedTaskRunner>& db_task_runner, |
+ StoreMap store_map) { |
+ // TODO(vakh): Implement skeleton |
+} |
+ |
+V4Database::~V4Database() {} |
+ |
+bool V4Database::ResetDatabase() { |
+ // TODO(vakh): Delete the stores. Delete the backing files. |
+ return true; |
+} |
+ |
+} // namespace safe_browsing |