Chromium Code Reviews| Index: components/safe_browsing_db/v4_store.cc |
| diff --git a/components/safe_browsing_db/v4_store.cc b/components/safe_browsing_db/v4_store.cc |
| index d16b76dcb0db154b076ceb152f7d63a01148b34c..0e02696fcce458f9bb7e17cc7d5e042c041217cd 100644 |
| --- a/components/safe_browsing_db/v4_store.cc |
| +++ b/components/safe_browsing_db/v4_store.cc |
| @@ -194,7 +194,9 @@ V4Store::V4Store(const scoped_refptr<base::SequencedTaskRunner>& task_runner, |
| const base::FilePath& store_path) |
| : store_path_(store_path), task_runner_(task_runner) {} |
| -V4Store::~V4Store() {} |
| +V4Store::~V4Store() { |
| + DCHECK(task_runner_->RunsTasksOnCurrentThread()); |
| +} |
| std::string V4Store::DebugString() const { |
| std::string state_base64; |
| @@ -204,6 +206,14 @@ std::string V4Store::DebugString() const { |
| store_path_.value().c_str(), state_base64.c_str()); |
| } |
| +// static |
| +void V4Store::Destroy(std::unique_ptr<V4Store> v4_store) { |
| + V4Store* v4_store_raw = v4_store.release(); |
| + if (v4_store_raw) { |
| + v4_store_raw->task_runner_->DeleteSoon(FROM_HERE, v4_store_raw); |
| + } |
|
Scott Hess - ex-Googler
2016/10/18 02:57:01
OK, yeah, same pattern as V4Database, makes sense.
|
| +} |
| + |
| void V4Store::Reset() { |
| expected_checksum_.clear(); |
| hash_prefix_map_.clear(); |