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

Unified Diff: base/prefs/scoped_user_pref_update.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/scoped_user_pref_update.h ('k') | base/prefs/testing_pref_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/prefs/scoped_user_pref_update.cc
diff --git a/base/prefs/scoped_user_pref_update.cc b/base/prefs/scoped_user_pref_update.cc
index 7871c75ce3783ab84156d188fd58b087927e2cfd..1440a5711d8f911d545dbcbbc792abb464bb13de 100644
--- a/base/prefs/scoped_user_pref_update.cc
+++ b/base/prefs/scoped_user_pref_update.cc
@@ -11,10 +11,8 @@
namespace subtle {
ScopedUserPrefUpdateBase::ScopedUserPrefUpdateBase(PrefService* service,
- const char* path)
- : service_(service),
- path_(path),
- value_(NULL) {
+ const std::string& path)
+ : service_(service), path_(path), value_(NULL) {
DCHECK(service_->CalledOnValidThread());
}
@@ -25,7 +23,7 @@ ScopedUserPrefUpdateBase::~ScopedUserPrefUpdateBase() {
base::Value* ScopedUserPrefUpdateBase::GetValueOfType(base::Value::Type type) {
DCHECK(CalledOnValidThread());
if (!value_)
- value_ = service_->GetMutableUserPref(path_.c_str(), type);
+ value_ = service_->GetMutableUserPref(path_, type);
return value_;
}
« no previous file with comments | « base/prefs/scoped_user_pref_update.h ('k') | base/prefs/testing_pref_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698