OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/bookmarks/browser/bookmark_model.h" | 5 #include "components/bookmarks/browser/bookmark_model.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 BookmarkModel::BookmarkModel(std::unique_ptr<BookmarkClient> client) | 110 BookmarkModel::BookmarkModel(std::unique_ptr<BookmarkClient> client) |
111 : client_(std::move(client)), | 111 : client_(std::move(client)), |
112 loaded_(false), | 112 loaded_(false), |
113 root_(GURL()), | 113 root_(GURL()), |
114 bookmark_bar_node_(NULL), | 114 bookmark_bar_node_(NULL), |
115 other_node_(NULL), | 115 other_node_(NULL), |
116 mobile_node_(NULL), | 116 mobile_node_(NULL), |
117 next_node_id_(1), | 117 next_node_id_(1), |
118 observers_( | 118 observers_( |
119 base::ObserverList<BookmarkModelObserver>::NOTIFY_EXISTING_ONLY), | 119 base::ObserverList<BookmarkModelObserver>::NOTIFY_EXISTING_ONLY), |
120 loaded_signal_(true, false), | 120 loaded_signal_(base::WaitableEvent::ResetPolicy::MANUAL, |
| 121 base::WaitableEvent::InitialState::NOT_SIGNALED), |
121 extensive_changes_(0), | 122 extensive_changes_(0), |
122 undo_delegate_(nullptr), | 123 undo_delegate_(nullptr), |
123 empty_undo_delegate_(new EmptyUndoDelegate) { | 124 empty_undo_delegate_(new EmptyUndoDelegate) { |
124 DCHECK(client_); | 125 DCHECK(client_); |
125 client_->Init(this); | 126 client_->Init(this); |
126 } | 127 } |
127 | 128 |
128 BookmarkModel::~BookmarkModel() { | 129 BookmarkModel::~BookmarkModel() { |
129 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_, | 130 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_, |
130 BookmarkModelBeingDeleted(this)); | 131 BookmarkModelBeingDeleted(this)); |
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1104 undo_delegate_ = undo_delegate; | 1105 undo_delegate_ = undo_delegate; |
1105 if (undo_delegate_) | 1106 if (undo_delegate_) |
1106 undo_delegate_->SetUndoProvider(this); | 1107 undo_delegate_->SetUndoProvider(this); |
1107 } | 1108 } |
1108 | 1109 |
1109 BookmarkUndoDelegate* BookmarkModel::undo_delegate() const { | 1110 BookmarkUndoDelegate* BookmarkModel::undo_delegate() const { |
1110 return undo_delegate_ ? undo_delegate_ : empty_undo_delegate_.get(); | 1111 return undo_delegate_ ? undo_delegate_ : empty_undo_delegate_.get(); |
1111 } | 1112 } |
1112 | 1113 |
1113 } // namespace bookmarks | 1114 } // namespace bookmarks |
OLD | NEW |