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

Unified Diff: base/prefs/pref_member.h

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_change_registrar_unittest.cc ('k') | base/prefs/pref_member.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/prefs/pref_member.h
diff --git a/base/prefs/pref_member.h b/base/prefs/pref_member.h
index a05d60ed36c25425f0acf6f202d8f6874eef3a70..b47cae264c99cd6a6d6005cd512ae09ab4fbd4f6 100644
--- a/base/prefs/pref_member.h
+++ b/base/prefs/pref_member.h
@@ -103,9 +103,10 @@ class BASE_PREFS_EXPORT PrefMemberBase : public PrefObserver {
virtual ~PrefMemberBase();
// See PrefMember<> for description.
- void Init(const char* pref_name, PrefService* prefs,
+ void Init(const std::string& pref_name,
+ PrefService* prefs,
const NamedChangeCallback& observer);
- void Init(const char* pref_name, PrefService* prefs);
+ void Init(const std::string& pref_name, PrefService* prefs);
virtual void CreateInternal() const = 0;
@@ -169,17 +170,19 @@ class PrefMember : public subtle::PrefMemberBase {
// Do the actual initialization of the class. Use the two-parameter
// version if you don't want any notifications of changes. This
// method should only be called on the UI thread.
- void Init(const char* pref_name, PrefService* prefs,
+ void Init(const std::string& pref_name,
+ PrefService* prefs,
const NamedChangeCallback& observer) {
subtle::PrefMemberBase::Init(pref_name, prefs, observer);
}
- void Init(const char* pref_name, PrefService* prefs,
+ void Init(const std::string& pref_name,
+ PrefService* prefs,
const base::Closure& observer) {
subtle::PrefMemberBase::Init(
pref_name, prefs,
base::Bind(&PrefMemberBase::InvokeUnnamedCallback, observer));
}
- void Init(const char* pref_name, PrefService* prefs) {
+ void Init(const std::string& pref_name, PrefService* prefs) {
subtle::PrefMemberBase::Init(pref_name, prefs);
}
« no previous file with comments | « base/prefs/pref_change_registrar_unittest.cc ('k') | base/prefs/pref_member.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698