OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "components/safe_browsing_db/v4_database.h" |
| 6 |
| 7 namespace safe_browsing { |
| 8 |
| 9 // static |
| 10 V4DatabaseFactory* V4Database::factory_ = NULL; |
| 11 |
| 12 // static |
| 13 // Factory method, should be called on the Safe Browsing sequenced task runner, |
| 14 // which is also passed to the function as |db_task_runner|. |
| 15 V4Database* V4Database::Create( |
| 16 const scoped_refptr<base::SequencedTaskRunner>& db_task_runner, |
| 17 const base::FilePath& base_path, |
| 18 ListInfoMap list_info_map) { |
| 19 DCHECK(db_task_runner->RunsTasksOnCurrentThread()); |
| 20 if (!factory_) { |
| 21 StoreMap store_map; |
| 22 // TODO(vakh): Populate the store_map using list_suffix_map. |
| 23 return new V4Database(db_task_runner, std::move(store_map)); |
| 24 } else { |
| 25 return factory_->CreateV4Database(db_task_runner, base_path, list_info_map); |
| 26 } |
| 27 } |
| 28 |
| 29 V4Database::V4Database( |
| 30 const scoped_refptr<base::SequencedTaskRunner>& db_task_runner, |
| 31 StoreMap store_map) { |
| 32 // TODO(vakh): Implement skeleton |
| 33 } |
| 34 |
| 35 V4Database::~V4Database() {} |
| 36 |
| 37 bool V4Database::ResetDatabase() { |
| 38 // TODO(vakh): Delete the stores. Delete the backing files. |
| 39 return true; |
| 40 } |
| 41 |
| 42 } // namespace safe_browsing |
OLD | NEW |