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

Unified Diff: ios/chrome/browser/reading_list/reading_list_model.cc

Issue 2369303002: Reading List create protobuf store (Closed)
Patch Set: threads Created 4 years, 3 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: ios/chrome/browser/reading_list/reading_list_model.cc
diff --git a/ios/chrome/browser/reading_list/reading_list_model.cc b/ios/chrome/browser/reading_list/reading_list_model.cc
index 073ec3b759bcd874dbe77596632d27bf012f54d7..a9e911f2a4bde254691ec82246c9e8cf799c631e 100644
--- a/ios/chrome/browser/reading_list/reading_list_model.cc
+++ b/ios/chrome/browser/reading_list/reading_list_model.cc
@@ -5,6 +5,7 @@
#include "ios/chrome/browser/reading_list/reading_list_model.h"
ReadingListModel::ReadingListModel() : current_batch_updates_count_(0) {}
+
ReadingListModel::~ReadingListModel() {}
// Observer methods.
@@ -32,17 +33,25 @@ ReadingListModel::BeginBatchUpdates() {
++current_batch_updates_count_;
if (current_batch_updates_count_ == 1) {
- FOR_EACH_OBSERVER(ReadingListModelObserver, observers_,
- ReadingListModelBeganBatchUpdates(this));
+ EnteringBatchUpdates();
}
return token;
}
+void ReadingListModel::EnteringBatchUpdates() {
+ FOR_EACH_OBSERVER(ReadingListModelObserver, observers_,
+ ReadingListModelBeganBatchUpdates(this));
+}
+
void ReadingListModel::EndBatchUpdates() {
DCHECK(IsPerformingBatchUpdates());
--current_batch_updates_count_;
if (current_batch_updates_count_ == 0) {
- FOR_EACH_OBSERVER(ReadingListModelObserver, observers_,
- ReadingListModelCompletedBatchUpdates(this));
+ LeavingBatchUpdates();
}
}
+
+void ReadingListModel::LeavingBatchUpdates() {
+ FOR_EACH_OBSERVER(ReadingListModelObserver, observers_,
+ ReadingListModelCompletedBatchUpdates(this));
+}

Powered by Google App Engine
This is Rietveld 408576698