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/core/reading_list_model_impl.h" | 5 #include "components/reading_list/core/reading_list_model_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } | 50 } |
51 DCHECK(read_entry_count_ + unread_entry_count_ == entries_->size()); | 51 DCHECK(read_entry_count_ + unread_entry_count_ == entries_->size()); |
52 loaded_ = true; | 52 loaded_ = true; |
53 for (auto& observer : observers_) | 53 for (auto& observer : observers_) |
54 observer.ReadingListModelLoaded(this); | 54 observer.ReadingListModelLoaded(this); |
55 } | 55 } |
56 | 56 |
57 void ReadingListModelImpl::Shutdown() { | 57 void ReadingListModelImpl::Shutdown() { |
58 DCHECK(CalledOnValidThread()); | 58 DCHECK(CalledOnValidThread()); |
59 for (auto& observer : observers_) | 59 for (auto& observer : observers_) |
60 observer.ReadingListModelBeingDeleted(this); | 60 observer.ReadingListModelBeingShutdown(this); |
61 loaded_ = false; | 61 loaded_ = false; |
62 } | 62 } |
63 | 63 |
64 bool ReadingListModelImpl::loaded() const { | 64 bool ReadingListModelImpl::loaded() const { |
65 DCHECK(CalledOnValidThread()); | 65 DCHECK(CalledOnValidThread()); |
66 return loaded_; | 66 return loaded_; |
67 } | 67 } |
68 | 68 |
69 size_t ReadingListModelImpl::size() const { | 69 size_t ReadingListModelImpl::size() const { |
70 DCHECK(CalledOnValidThread()); | 70 DCHECK(CalledOnValidThread()); |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 | 536 |
537 syncer::ModelTypeSyncBridge* ReadingListModelImpl::GetModelTypeSyncBridge() { | 537 syncer::ModelTypeSyncBridge* ReadingListModelImpl::GetModelTypeSyncBridge() { |
538 if (!storage_layer_) | 538 if (!storage_layer_) |
539 return nullptr; | 539 return nullptr; |
540 return storage_layer_.get(); | 540 return storage_layer_.get(); |
541 } | 541 } |
542 | 542 |
543 ReadingListModelStorage* ReadingListModelImpl::StorageLayer() { | 543 ReadingListModelStorage* ReadingListModelImpl::StorageLayer() { |
544 return storage_layer_.get(); | 544 return storage_layer_.get(); |
545 } | 545 } |
OLD | NEW |