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

Unified Diff: components/reading_list/core/reading_list_model.cc

Issue 2914583002: Replace deprecated base::NonThreadSafe in components/reading_list in favor of SequenceChecker. (Closed)
Patch Set: 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
Index: components/reading_list/core/reading_list_model.cc
diff --git a/components/reading_list/core/reading_list_model.cc b/components/reading_list/core/reading_list_model.cc
index d3d2829a553286d76d43c36c0f2db5c54dc78d62..04252bc6873dd7c0a3bfbd3b9730a2b92bf78c6d 100644
--- a/components/reading_list/core/reading_list_model.cc
+++ b/components/reading_list/core/reading_list_model.cc
@@ -10,6 +10,7 @@
ReadingListModel::ReadingListModel() : current_batch_updates_count_(0) {}
ReadingListModel::~ReadingListModel() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
for (auto& observer : observers_) {
observer.ReadingListModelBeingDeleted(this);
}
@@ -17,7 +18,7 @@ ReadingListModel::~ReadingListModel() {
// Observer methods.
void ReadingListModel::AddObserver(ReadingListModelObserver* observer) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(observer);
observers_.AddObserver(observer);
if (loaded()) {
@@ -26,13 +27,13 @@ void ReadingListModel::AddObserver(ReadingListModelObserver* observer) {
}
void ReadingListModel::RemoveObserver(ReadingListModelObserver* observer) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
observers_.RemoveObserver(observer);
}
// Batch update methods.
bool ReadingListModel::IsPerformingBatchUpdates() const {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return current_batch_updates_count_ > 0;
}
@@ -43,7 +44,7 @@ ReadingListModel::CreateBatchToken() {
std::unique_ptr<ReadingListModel::ScopedReadingListBatchUpdate>
ReadingListModel::BeginBatchUpdates() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
auto token = CreateBatchToken();
++current_batch_updates_count_;
@@ -54,13 +55,13 @@ ReadingListModel::BeginBatchUpdates() {
}
void ReadingListModel::EnteringBatchUpdates() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
for (auto& observer : observers_)
observer.ReadingListModelBeganBatchUpdates(this);
}
void ReadingListModel::EndBatchUpdates() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(IsPerformingBatchUpdates());
DCHECK(current_batch_updates_count_ > 0);
--current_batch_updates_count_;
@@ -70,7 +71,7 @@ void ReadingListModel::EndBatchUpdates() {
}
void ReadingListModel::LeavingBatchUpdates() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
for (auto& observer : observers_)
observer.ReadingListModelCompletedBatchUpdates(this);
}
« no previous file with comments | « components/reading_list/core/reading_list_model.h ('k') | components/reading_list/core/reading_list_model_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698