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

Side by Side Diff: components/invalidation/impl/sync_system_resources.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/sync_system_resources.h" 5 #include "components/invalidation/impl/sync_system_resources.h"
6 6
7 #include <cstdlib> 7 #include <cstdlib>
8 #include <cstring> 8 #include <cstring>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 // Notify NetworkStatusReceivers in cacheinvalidation. 186 // Notify NetworkStatusReceivers in cacheinvalidation.
187 for (NetworkStatusReceiverList::const_iterator it = 187 for (NetworkStatusReceiverList::const_iterator it =
188 network_status_receivers_.begin(); 188 network_status_receivers_.begin();
189 it != network_status_receivers_.end(); ++it) { 189 it != network_status_receivers_.end(); ++it) {
190 (*it)->Run(online); 190 (*it)->Run(online);
191 } 191 }
192 } 192 }
193 193
194 void SyncNetworkChannel::NotifyChannelStateChange( 194 void SyncNetworkChannel::NotifyChannelStateChange(
195 InvalidatorState invalidator_state) { 195 InvalidatorState invalidator_state) {
196 FOR_EACH_OBSERVER(Observer, observers_, 196 for (auto& observer : observers_)
197 OnNetworkChannelStateChanged(invalidator_state)); 197 observer.OnNetworkChannelStateChanged(invalidator_state);
198 } 198 }
199 199
200 bool SyncNetworkChannel::DeliverIncomingMessage(const std::string& message) { 200 bool SyncNetworkChannel::DeliverIncomingMessage(const std::string& message) {
201 if (!incoming_receiver_) { 201 if (!incoming_receiver_) {
202 DLOG(ERROR) << "No receiver for incoming notification"; 202 DLOG(ERROR) << "No receiver for incoming notification";
203 return false; 203 return false;
204 } 204 }
205 received_messages_count_++; 205 received_messages_count_++;
206 incoming_receiver_->Run(message); 206 incoming_receiver_->Run(message);
207 return true; 207 return true;
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 329
330 SyncInvalidationScheduler* SyncSystemResources::internal_scheduler() { 330 SyncInvalidationScheduler* SyncSystemResources::internal_scheduler() {
331 return internal_scheduler_.get(); 331 return internal_scheduler_.get();
332 } 332 }
333 333
334 SyncInvalidationScheduler* SyncSystemResources::listener_scheduler() { 334 SyncInvalidationScheduler* SyncSystemResources::listener_scheduler() {
335 return listener_scheduler_.get(); 335 return listener_scheduler_.get();
336 } 336 }
337 337
338 } // namespace syncer 338 } // namespace syncer
OLDNEW
« no previous file with comments | « components/invalidation/impl/invalidator_registrar.cc ('k') | components/invalidation/impl/ticl_settings_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698