Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(695)

Unified Diff: base/files/important_file_writer.cc

Issue 2907303002: Replace deprecated base::NonThreadSafe in base in favor of SequenceChecker. (Closed)
Patch Set: rm sequence check in constructor Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/files/important_file_writer.h ('k') | base/message_loop/message_pump.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0696c96b6c955e388dcb0f6af8398ccb9033f8cb 100644
--- a/base/files/important_file_writer.cc
+++ b/base/files/important_file_writer.cc
@@ -152,11 +152,11 @@ ImportantFileWriter::ImportantFileWriter(
serializer_(nullptr),
commit_interval_(interval),
weak_factory_(this) {
- DCHECK(CalledOnValidThread());
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 +164,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 +192,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;
« no previous file with comments | « base/files/important_file_writer.h ('k') | base/message_loop/message_pump.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698