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

Unified Diff: components/browser_sync/profile_sync_service.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/invalidation/impl/invalidation_logger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/browser_sync/profile_sync_service.cc
diff --git a/components/browser_sync/profile_sync_service.cc b/components/browser_sync/profile_sync_service.cc
index 81dcf3f3d75bd012e320b0bee3d2a80255613dd3..0a299982a6d4936324ee066eacb9607e2d45f760 100644
--- a/components/browser_sync/profile_sync_service.cc
+++ b/components/browser_sync/profile_sync_service.cc
@@ -529,29 +529,29 @@ bool ProfileSyncService::IsEncryptedDatatypeEnabled() const {
}
void ProfileSyncService::OnProtocolEvent(const syncer::ProtocolEvent& event) {
- FOR_EACH_OBSERVER(ProtocolEventObserver, protocol_event_observers_,
- OnProtocolEvent(event));
+ for (auto& observer : protocol_event_observers_)
+ observer.OnProtocolEvent(event);
}
void ProfileSyncService::OnDirectoryTypeCommitCounterUpdated(
syncer::ModelType type,
const syncer::CommitCounters& counters) {
- FOR_EACH_OBSERVER(syncer::TypeDebugInfoObserver, type_debug_info_observers_,
- OnCommitCountersUpdated(type, counters));
+ for (auto& observer : type_debug_info_observers_)
+ observer.OnCommitCountersUpdated(type, counters);
}
void ProfileSyncService::OnDirectoryTypeUpdateCounterUpdated(
syncer::ModelType type,
const syncer::UpdateCounters& counters) {
- FOR_EACH_OBSERVER(syncer::TypeDebugInfoObserver, type_debug_info_observers_,
- OnUpdateCountersUpdated(type, counters));
+ for (auto& observer : type_debug_info_observers_)
+ observer.OnUpdateCountersUpdated(type, counters);
}
void ProfileSyncService::OnDatatypeStatusCounterUpdated(
syncer::ModelType type,
const syncer::StatusCounters& counters) {
- FOR_EACH_OBSERVER(syncer::TypeDebugInfoObserver, type_debug_info_observers_,
- OnStatusCountersUpdated(type, counters));
+ for (auto& observer : type_debug_info_observers_)
+ observer.OnStatusCountersUpdated(type, counters);
}
void ProfileSyncService::OnDataTypeRequestsSyncStartup(syncer::ModelType type) {
@@ -831,17 +831,18 @@ void ProfileSyncService::UpdateLastSyncedTime() {
}
void ProfileSyncService::NotifyObservers() {
- FOR_EACH_OBSERVER(syncer::SyncServiceObserver, observers_, OnStateChanged());
+ for (auto& observer : observers_)
+ observer.OnStateChanged();
}
void ProfileSyncService::NotifySyncCycleCompleted() {
- FOR_EACH_OBSERVER(syncer::SyncServiceObserver, observers_,
- OnSyncCycleCompleted());
+ for (auto& observer : observers_)
+ observer.OnSyncCycleCompleted();
}
void ProfileSyncService::NotifyForeignSessionUpdated() {
- FOR_EACH_OBSERVER(syncer::SyncServiceObserver, observers_,
- OnForeignSessionUpdated());
+ for (auto& observer : observers_)
+ observer.OnForeignSessionUpdated();
}
void ProfileSyncService::ClearStaleErrors() {
@@ -1329,8 +1330,8 @@ void ProfileSyncService::OnConfigureDone(
}
// Notify listeners that configuration is done.
- FOR_EACH_OBSERVER(syncer::SyncServiceObserver, observers_,
- OnSyncConfigurationCompleted());
+ for (auto& observer : observers_)
+ observer.OnSyncConfigurationCompleted();
DVLOG(1) << "PSS OnConfigureDone called with status: " << configure_status_;
// The possible status values:
« no previous file with comments | « no previous file | components/invalidation/impl/invalidation_logger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698