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

Side by Side Diff: trunk/src/base/prefs/pref_notifier_impl.cc

Issue 289373006: Revert 271416 "Store a stacktrace of PrefService destruction in ..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
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 "base/prefs/pref_notifier_impl.h" 5 #include "base/prefs/pref_notifier_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 10
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 PrefInitObserverList observers(init_observers_); 87 PrefInitObserverList observers(init_observers_);
88 init_observers_.clear(); 88 init_observers_.clear();
89 89
90 for (PrefInitObserverList::iterator it = observers.begin(); 90 for (PrefInitObserverList::iterator it = observers.begin();
91 it != observers.end(); 91 it != observers.end();
92 ++it) { 92 ++it) {
93 it->Run(succeeded); 93 it->Run(succeeded);
94 } 94 }
95 } 95 }
96 96
97 // TODO(battre): Delete this. See crbug.com/373435.
98 void PrefNotifierImpl::BroadcastPrefServiceDestructionTrace(
99 const std::string& stack_trace) {
100 DCHECK(thread_checker_.CalledOnValidThread());
101 for (PrefObserverMap::iterator observer_iterator = pref_observers_.begin();
102 observer_iterator != pref_observers_.end();
103 ++observer_iterator) {
104 FOR_EACH_OBSERVER(PrefObserver,
105 *(observer_iterator->second),
106 SetPrefServiceDestructionTrace(stack_trace));
107 }
108 }
109
110 void PrefNotifierImpl::FireObservers(const std::string& path) { 97 void PrefNotifierImpl::FireObservers(const std::string& path) {
111 DCHECK(thread_checker_.CalledOnValidThread()); 98 DCHECK(thread_checker_.CalledOnValidThread());
112 99
113 // Only send notifications for registered preferences. 100 // Only send notifications for registered preferences.
114 if (!pref_service_->FindPreference(path.c_str())) 101 if (!pref_service_->FindPreference(path.c_str()))
115 return; 102 return;
116 103
117 const PrefObserverMap::iterator observer_iterator = 104 const PrefObserverMap::iterator observer_iterator =
118 pref_observers_.find(path); 105 pref_observers_.find(path);
119 if (observer_iterator == pref_observers_.end()) 106 if (observer_iterator == pref_observers_.end())
120 return; 107 return;
121 108
122 FOR_EACH_OBSERVER(PrefObserver, 109 FOR_EACH_OBSERVER(PrefObserver,
123 *(observer_iterator->second), 110 *(observer_iterator->second),
124 OnPreferenceChanged(pref_service_, path)); 111 OnPreferenceChanged(pref_service_, path));
125 } 112 }
126 113
127 void PrefNotifierImpl::SetPrefService(PrefService* pref_service) { 114 void PrefNotifierImpl::SetPrefService(PrefService* pref_service) {
128 DCHECK(pref_service_ == NULL); 115 DCHECK(pref_service_ == NULL);
129 pref_service_ = pref_service; 116 pref_service_ = pref_service;
130 } 117 }
OLDNEW
« no previous file with comments | « trunk/src/base/prefs/pref_notifier_impl.h ('k') | trunk/src/base/prefs/pref_notifier_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698