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

Side by Side Diff: components/invalidation/impl/invalidator_registrar.cc

Issue 2427913002: Reduce usage of FOR_EACH_OBSERVER macro in components/invalidation (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
OLDNEW
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/invalidation/impl/invalidator_registrar.h" 5 #include "components/invalidation/impl/invalidator_registrar.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <iterator> 8 #include <iterator>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 it->first->OnIncomingInvalidation(to_emit); 108 it->first->OnIncomingInvalidation(to_emit);
109 } 109 }
110 } 110 }
111 } 111 }
112 112
113 void InvalidatorRegistrar::UpdateInvalidatorState(InvalidatorState state) { 113 void InvalidatorRegistrar::UpdateInvalidatorState(InvalidatorState state) {
114 DCHECK(thread_checker_.CalledOnValidThread()); 114 DCHECK(thread_checker_.CalledOnValidThread());
115 DVLOG(1) << "New invalidator state: " << InvalidatorStateToString(state_) 115 DVLOG(1) << "New invalidator state: " << InvalidatorStateToString(state_)
116 << " -> " << InvalidatorStateToString(state); 116 << " -> " << InvalidatorStateToString(state);
117 state_ = state; 117 state_ = state;
118 FOR_EACH_OBSERVER(InvalidationHandler, handlers_, 118 for (auto& observer : handlers_)
119 OnInvalidatorStateChange(state)); 119 observer.OnInvalidatorStateChange(state);
120 } 120 }
121 121
122 InvalidatorState InvalidatorRegistrar::GetInvalidatorState() const { 122 InvalidatorState InvalidatorRegistrar::GetInvalidatorState() const {
123 DCHECK(thread_checker_.CalledOnValidThread()); 123 DCHECK(thread_checker_.CalledOnValidThread());
124 return state_; 124 return state_;
125 } 125 }
126 126
127 std::map<std::string, ObjectIdSet> 127 std::map<std::string, ObjectIdSet>
128 InvalidatorRegistrar::GetSanitizedHandlersIdsMap() { 128 InvalidatorRegistrar::GetSanitizedHandlersIdsMap() {
129 DCHECK(thread_checker_.CalledOnValidThread()); 129 DCHECK(thread_checker_.CalledOnValidThread());
(...skipping 11 matching lines...) Expand all
141 DCHECK(thread_checker_.CalledOnValidThread()); 141 DCHECK(thread_checker_.CalledOnValidThread());
142 return handlers_.HasObserver(handler); 142 return handlers_.HasObserver(handler);
143 } 143 }
144 144
145 void InvalidatorRegistrar::DetachFromThreadForTest() { 145 void InvalidatorRegistrar::DetachFromThreadForTest() {
146 DCHECK(thread_checker_.CalledOnValidThread()); 146 DCHECK(thread_checker_.CalledOnValidThread());
147 thread_checker_.DetachFromThread(); 147 thread_checker_.DetachFromThread();
148 } 148 }
149 149
150 } // namespace syncer 150 } // namespace syncer
OLDNEW
« no previous file with comments | « components/invalidation/impl/invalidation_logger.cc ('k') | components/invalidation/impl/sync_system_resources.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698