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

Side by Side Diff: components/syncable_prefs/pref_model_associator.cc

Issue 2430823002: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/syncable_prefs/pref_model_associator.h" 5 #include "components/syncable_prefs/pref_model_associator.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 DCHECK(pref_service_ == NULL); 531 DCHECK(pref_service_ == NULL);
532 pref_service_ = pref_service; 532 pref_service_ = pref_service;
533 } 533 }
534 534
535 void PrefModelAssociator::NotifySyncedPrefObservers(const std::string& path, 535 void PrefModelAssociator::NotifySyncedPrefObservers(const std::string& path,
536 bool from_sync) const { 536 bool from_sync) const {
537 auto observer_iter = synced_pref_observers_.find(path); 537 auto observer_iter = synced_pref_observers_.find(path);
538 if (observer_iter == synced_pref_observers_.end()) 538 if (observer_iter == synced_pref_observers_.end())
539 return; 539 return;
540 SyncedPrefObserverList* observers = observer_iter->second.get(); 540 SyncedPrefObserverList* observers = observer_iter->second.get();
541 FOR_EACH_OBSERVER(SyncedPrefObserver, *observers, 541 for (auto& observer : *observers)
542 OnSyncedPrefChanged(path, from_sync)); 542 observer.OnSyncedPrefChanged(path, from_sync);
543 } 543 }
544 544
545 } // namespace syncable_prefs 545 } // namespace syncable_prefs
OLDNEW
« no previous file with comments | « components/sessions/core/tab_restore_service_helper.cc ('k') | components/syncable_prefs/pref_service_syncable.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698