Chromium Code Reviews| Index: base/files/important_file_writer.cc |
| diff --git a/base/files/important_file_writer.cc b/base/files/important_file_writer.cc |
| index 5088bd9967ba1e94420c99e29a9c44b654399a43..d7b1dce770f57ea183827daa6d8d907f3af1b685 100644 |
| --- a/base/files/important_file_writer.cc |
| +++ b/base/files/important_file_writer.cc |
| @@ -152,11 +152,12 @@ ImportantFileWriter::ImportantFileWriter( |
| serializer_(nullptr), |
| commit_interval_(interval), |
| weak_factory_(this) { |
| - DCHECK(CalledOnValidThread()); |
| + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
|
Nico
2017/05/30 03:03:47
Doing this in the ctor is pointless, isn't it?
gab
2017/05/30 14:46:58
Indeed but the script doesn't know that :), fixed.
|
| DCHECK(task_runner_); |
| } |
| ImportantFileWriter::~ImportantFileWriter() { |
| + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| // We're usually a member variable of some other object, which also tends |
| // to be our serializer. It may not be safe to call back to the parent object |
| // being destructed. |
| @@ -164,12 +165,12 @@ ImportantFileWriter::~ImportantFileWriter() { |
| } |
| bool ImportantFileWriter::HasPendingWrite() const { |
| - DCHECK(CalledOnValidThread()); |
| + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| return timer().IsRunning(); |
| } |
| void ImportantFileWriter::WriteNow(std::unique_ptr<std::string> data) { |
| - DCHECK(CalledOnValidThread()); |
| + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| if (!IsValueInRangeForNumericType<int32_t>(data->length())) { |
| NOTREACHED(); |
| return; |
| @@ -192,7 +193,7 @@ void ImportantFileWriter::WriteNow(std::unique_ptr<std::string> data) { |
| } |
| void ImportantFileWriter::ScheduleWrite(DataSerializer* serializer) { |
| - DCHECK(CalledOnValidThread()); |
| + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| DCHECK(serializer); |
| serializer_ = serializer; |