| Index: chrome/browser/safe_browsing/safe_browsing_store_file.cc
|
| diff --git a/chrome/browser/safe_browsing/safe_browsing_store_file.cc b/chrome/browser/safe_browsing/safe_browsing_store_file.cc
|
| index 47c3f9efafd73e8fb954b0a5130230f3fd2f2b0b..60fdb4da8de9b904f302e88340da7640114f2206 100644
|
| --- a/chrome/browser/safe_browsing/safe_browsing_store_file.cc
|
| +++ b/chrome/browser/safe_browsing/safe_browsing_store_file.cc
|
| @@ -554,16 +554,25 @@ bool ReadDbStateHelper(const base::FilePath& filename,
|
|
|
| } // namespace
|
|
|
| -SafeBrowsingStoreFile::SafeBrowsingStoreFile()
|
| - : chunks_written_(0), empty_(false), corruption_seen_(false) {}
|
| +SafeBrowsingStoreFile::SafeBrowsingStoreFile(
|
| + const scoped_refptr<const base::SequencedTaskRunner>& task_runner)
|
| + : task_runner_(task_runner),
|
| + chunks_written_(0),
|
| + empty_(false),
|
| + corruption_seen_(false) {
|
| +}
|
|
|
| SafeBrowsingStoreFile::~SafeBrowsingStoreFile() {
|
| // Thread-checking is disabled in the destructor due to crbug.com/338486.
|
| - DetachFromThread();
|
| + task_runner_ = nullptr;
|
|
|
| Close();
|
| }
|
|
|
| +bool SafeBrowsingStoreFile::CalledOnValidThread() {
|
| + return !task_runner_ || task_runner_->RunsTasksOnCurrentThread();
|
| +}
|
| +
|
| bool SafeBrowsingStoreFile::Delete() {
|
| DCHECK(CalledOnValidThread());
|
|
|
|
|