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

Unified Diff: base/prefs/pref_notifier_impl.cc

Issue 753603002: Change preference APIs to take std::string instead of const char*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed all calls to c_str() in prefs. Created 6 years 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
« no previous file with comments | « base/prefs/pref_notifier_impl.h ('k') | base/prefs/pref_notifier_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/prefs/pref_notifier_impl.cc
diff --git a/base/prefs/pref_notifier_impl.cc b/base/prefs/pref_notifier_impl.cc
index c02a7b3f5a5bfd8d4bd5c56ce20ca699e6d10346..6bf960388677153105370d2f2a9b5e2c80e72a5c 100644
--- a/base/prefs/pref_notifier_impl.cc
+++ b/base/prefs/pref_notifier_impl.cc
@@ -38,7 +38,7 @@ PrefNotifierImpl::~PrefNotifierImpl() {
init_observers_.clear();
}
-void PrefNotifierImpl::AddPrefObserver(const char* path,
+void PrefNotifierImpl::AddPrefObserver(const std::string& path,
PrefObserver* obs) {
// Get the pref observer list associated with the path.
PrefObserverList* observer_list = NULL;
@@ -56,7 +56,7 @@ void PrefNotifierImpl::AddPrefObserver(const char* path,
observer_list->AddObserver(obs);
}
-void PrefNotifierImpl::RemovePrefObserver(const char* path,
+void PrefNotifierImpl::RemovePrefObserver(const std::string& path,
PrefObserver* obs) {
DCHECK(thread_checker_.CalledOnValidThread());
@@ -98,7 +98,7 @@ void PrefNotifierImpl::FireObservers(const std::string& path) {
DCHECK(thread_checker_.CalledOnValidThread());
// Only send notifications for registered preferences.
- if (!pref_service_->FindPreference(path.c_str()))
+ if (!pref_service_->FindPreference(path))
return;
const PrefObserverMap::iterator observer_iterator =
« no previous file with comments | « base/prefs/pref_notifier_impl.h ('k') | base/prefs/pref_notifier_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698