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

Unified Diff: content/browser/notification_service_impl.cc

Issue 2422923002: Reduce usage of FOR_EACH_OBSERVER macro in content/browser (Closed)
Patch Set: skip cases in 2418143004 and 2418373002 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: content/browser/notification_service_impl.cc
diff --git a/content/browser/notification_service_impl.cc b/content/browser/notification_service_impl.cc
index 27de8579fe8f639120754cdc768f1a0a2955470e..b732ca7cf4000ba7d16cecff50701051e416a0c0 100644
--- a/content/browser/notification_service_impl.cc
+++ b/content/browser/notification_service_impl.cc
@@ -105,31 +105,27 @@ void NotificationServiceImpl::Notify(int type,
// Notify observers of all types and all sources
if (HasKey(observers_[NOTIFICATION_ALL], AllSources()) &&
source != AllSources()) {
- FOR_EACH_OBSERVER(NotificationObserver,
- *observers_[NOTIFICATION_ALL][AllSources().map_key()],
- Observe(type, source, details));
+ for (auto& observer : *observers_[NOTIFICATION_ALL][AllSources().map_key()])
+ observer.Observe(type, source, details);
}
// Notify observers of all types and the given source
if (HasKey(observers_[NOTIFICATION_ALL], source)) {
- FOR_EACH_OBSERVER(NotificationObserver,
- *observers_[NOTIFICATION_ALL][source.map_key()],
- Observe(type, source, details));
+ for (auto& observer : *observers_[NOTIFICATION_ALL][source.map_key()])
+ observer.Observe(type, source, details);
}
// Notify observers of the given type and all sources
if (HasKey(observers_[type], AllSources()) &&
source != AllSources()) {
- FOR_EACH_OBSERVER(NotificationObserver,
- *observers_[type][AllSources().map_key()],
- Observe(type, source, details));
+ for (auto& observer : *observers_[type][AllSources().map_key()])
+ observer.Observe(type, source, details);
}
// Notify observers of the given type and the given source
if (HasKey(observers_[type], source)) {
- FOR_EACH_OBSERVER(NotificationObserver,
- *observers_[type][source.map_key()],
- Observe(type, source, details));
+ for (auto& observer : *observers_[type][source.map_key()])
+ observer.Observe(type, source, details);
}
}
« no previous file with comments | « content/browser/frame_host/frame_tree_node.cc ('k') | content/browser/shared_worker/shared_worker_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698