OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/reading_list/ios/reading_list_model.h" | 5 #include "components/reading_list/core/reading_list_model.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 | 9 |
10 ReadingListModel::ReadingListModel() : current_batch_updates_count_(0) {} | 10 ReadingListModel::ReadingListModel() : current_batch_updates_count_(0) {} |
11 | 11 |
12 ReadingListModel::~ReadingListModel() { | 12 ReadingListModel::~ReadingListModel() { |
13 for (auto& observer : observers_) { | 13 for (auto& observer : observers_) { |
14 observer.ReadingListModelBeingDeleted(this); | 14 observer.ReadingListModelBeingDeleted(this); |
15 } | 15 } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 void ReadingListModel::LeavingBatchUpdates() { | 72 void ReadingListModel::LeavingBatchUpdates() { |
73 DCHECK(CalledOnValidThread()); | 73 DCHECK(CalledOnValidThread()); |
74 for (auto& observer : observers_) | 74 for (auto& observer : observers_) |
75 observer.ReadingListModelCompletedBatchUpdates(this); | 75 observer.ReadingListModelCompletedBatchUpdates(this); |
76 } | 76 } |
77 | 77 |
78 ReadingListModel::ScopedReadingListBatchUpdate:: | 78 ReadingListModel::ScopedReadingListBatchUpdate:: |
79 ~ScopedReadingListBatchUpdate() { | 79 ~ScopedReadingListBatchUpdate() { |
80 model_->EndBatchUpdates(); | 80 model_->EndBatchUpdates(); |
81 } | 81 } |
OLD | NEW |