Chromium Code Reviews| 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..358ecf684e754b115dff07d7d37cd4b24e91b264 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( |
| + scoped_refptr<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; |
|
gab
2015/02/19 14:38:23
No need to do this, just have a commented out:
//
Alexei Svitkine (slow)
2015/02/20 15:42:44
The issue is that Close() has that check.
|
| Close(); |
| } |
| +bool SafeBrowsingStoreFile::CalledOnValidThread() { |
| + return !task_runner_ || task_runner_->RunsTasksOnCurrentThread(); |
|
gab
2015/02/19 14:38:23
You can get rid of this I think and just inline
D
Alexei Svitkine (slow)
2015/02/20 15:42:44
I prefer keeping it a separate method, which doesn
|
| +} |
| + |
| bool SafeBrowsingStoreFile::Delete() { |
| DCHECK(CalledOnValidThread()); |