diff options
Diffstat (limited to 'base')
-rw-r--r-- | base/prefs/pref_notifier_impl.cc | 8 | ||||
-rw-r--r-- | base/prefs/pref_notifier_impl.h | 7 |
2 files changed, 8 insertions, 7 deletions
diff --git a/base/prefs/pref_notifier_impl.cc b/base/prefs/pref_notifier_impl.cc index 1fa495d..c02a7b3 100644 --- a/base/prefs/pref_notifier_impl.cc +++ b/base/prefs/pref_notifier_impl.cc @@ -17,7 +17,7 @@ PrefNotifierImpl::PrefNotifierImpl(PrefService* service) } PrefNotifierImpl::~PrefNotifierImpl() { - DCHECK(CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); // Verify that there are no pref observers when we shut down. for (PrefObserverMap::iterator it = pref_observers_.begin(); @@ -58,7 +58,7 @@ void PrefNotifierImpl::AddPrefObserver(const char* path, void PrefNotifierImpl::RemovePrefObserver(const char* path, PrefObserver* obs) { - DCHECK(CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); const PrefObserverMap::iterator observer_iterator = pref_observers_.find(path); @@ -79,7 +79,7 @@ void PrefNotifierImpl::OnPreferenceChanged(const std::string& path) { } void PrefNotifierImpl::OnInitializationCompleted(bool succeeded) { - DCHECK(CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); // We must make a copy of init_observers_ and clear it before we run // observers, or we can end up in this method re-entrantly before @@ -95,7 +95,7 @@ void PrefNotifierImpl::OnInitializationCompleted(bool succeeded) { } void PrefNotifierImpl::FireObservers(const std::string& path) { - DCHECK(CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); // Only send notifications for registered preferences. if (!pref_service_->FindPreference(path.c_str())) diff --git a/base/prefs/pref_notifier_impl.h b/base/prefs/pref_notifier_impl.h index 8e6f090..8f5120a 100644 --- a/base/prefs/pref_notifier_impl.h +++ b/base/prefs/pref_notifier_impl.h @@ -15,14 +15,13 @@ #include "base/prefs/base_prefs_export.h" #include "base/prefs/pref_notifier.h" #include "base/prefs/pref_observer.h" -#include "base/threading/non_thread_safe.h" +#include "base/threading/thread_checker.h" class PrefService; // The PrefNotifier implementation used by the PrefService. class BASE_PREFS_EXPORT PrefNotifierImpl - : public NON_EXPORTED_BASE(PrefNotifier), - public base::NonThreadSafe { + : public NON_EXPORTED_BASE(PrefNotifier) { public: PrefNotifierImpl(); explicit PrefNotifierImpl(PrefService* pref_service); @@ -66,6 +65,8 @@ class BASE_PREFS_EXPORT PrefNotifierImpl PrefObserverMap pref_observers_; PrefInitObserverList init_observers_; + base::ThreadChecker thread_checker_; + DISALLOW_COPY_AND_ASSIGN(PrefNotifierImpl); }; |