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

Unified Diff: components/prefs/default_pref_store.cc

Issue 2444753002: Reduce usage of FOR_EACH_OBSERVER macro in components/ (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
Index: components/prefs/default_pref_store.cc
diff --git a/components/prefs/default_pref_store.cc b/components/prefs/default_pref_store.cc
index ed401899c871a1bd11e7289979183261e60e6029..468c11c74835a56871d48f40167c486ad4a5cd5b 100644
--- a/components/prefs/default_pref_store.cc
+++ b/components/prefs/default_pref_store.cc
@@ -41,8 +41,10 @@ void DefaultPrefStore::ReplaceDefaultValue(const std::string& key,
GetValue(key, &old_value);
bool notify = !old_value->Equals(value.get());
prefs_.SetValue(key, std::move(value));
- if (notify)
- FOR_EACH_OBSERVER(Observer, observers_, OnPrefValueChanged(key));
+ if (notify) {
+ for (Observer& observer : observers_)
+ observer.OnPrefValueChanged(key);
+ }
}
DefaultPrefStore::const_iterator DefaultPrefStore::begin() const {
« no previous file with comments | « components/physical_web/data_source/physical_web_data_source_impl.cc ('k') | components/prefs/in_memory_pref_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698