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

Unified Diff: components/sync/engine_impl/sync_scheduler_impl.cc

Issue 2424673002: Remove usage of FOR_EACH_OBSERVER macro in components/sync (Closed)
Patch Set: blank line before return 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 side-by-side diff with in-line comments
Download patch
Index: components/sync/engine_impl/sync_scheduler_impl.cc
diff --git a/components/sync/engine_impl/sync_scheduler_impl.cc b/components/sync/engine_impl/sync_scheduler_impl.cc
index 204f89079fa33bbf3489c2ab70c57dc7984a0938..d1ce96979409452be6c22b49a9f561cbdde82a5f 100644
--- a/components/sync/engine_impl/sync_scheduler_impl.cc
+++ b/components/sync/engine_impl/sync_scheduler_impl.cc
@@ -281,8 +281,8 @@ void SyncSchedulerImpl::SendInitialSnapshot() {
std::unique_ptr<SyncCycle> dummy(SyncCycle::Build(cycle_context_, this));
SyncCycleEvent event(SyncCycleEvent::STATUS_CHANGED);
event.snapshot = dummy->TakeSnapshot();
- FOR_EACH_OBSERVER(SyncEngineEventListener, *cycle_context_->listeners(),
- OnSyncCycleEvent(event));
+ for (auto& observer : *cycle_context_->listeners())
+ observer.OnSyncCycleEvent(event);
}
namespace {
@@ -843,13 +843,13 @@ void SyncSchedulerImpl::ExponentialBackoffRetry() {
}
void SyncSchedulerImpl::NotifyRetryTime(base::Time retry_time) {
- FOR_EACH_OBSERVER(SyncEngineEventListener, *cycle_context_->listeners(),
- OnRetryTimeChanged(retry_time));
+ for (auto& observer : *cycle_context_->listeners())
+ observer.OnRetryTimeChanged(retry_time);
}
void SyncSchedulerImpl::NotifyThrottledTypesChanged(ModelTypeSet types) {
- FOR_EACH_OBSERVER(SyncEngineEventListener, *cycle_context_->listeners(),
- OnThrottledTypesChanged(types));
+ for (auto& observer : *cycle_context_->listeners())
+ observer.OnThrottledTypesChanged(types);
}
bool SyncSchedulerImpl::IsBackingOff() const {
@@ -934,8 +934,8 @@ void SyncSchedulerImpl::OnSyncProtocolError(
}
if (IsActionableError(sync_protocol_error)) {
SDVLOG(2) << "OnActionableError";
- FOR_EACH_OBSERVER(SyncEngineEventListener, *cycle_context_->listeners(),
- OnActionableError(sync_protocol_error));
+ for (auto& observer : *cycle_context_->listeners())
+ observer.OnActionableError(sync_protocol_error);
}
}
@@ -946,8 +946,8 @@ void SyncSchedulerImpl::OnReceivedGuRetryDelay(const base::TimeDelta& delay) {
}
void SyncSchedulerImpl::OnReceivedMigrationRequest(ModelTypeSet types) {
- FOR_EACH_OBSERVER(SyncEngineEventListener, *cycle_context_->listeners(),
- OnMigrationRequested(types));
+ for (auto& observer : *cycle_context_->listeners())
+ observer.OnMigrationRequested(types);
}
void SyncSchedulerImpl::SetNotificationsEnabled(bool notifications_enabled) {
« no previous file with comments | « components/sync/engine_impl/net/server_connection_manager.cc ('k') | components/sync/js/sync_js_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698