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

Unified Diff: base/prefs/default_pref_store.cc

Issue 11365112: Change PrefStore::ReadResult to a boolean. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 8 years, 1 month 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/default_pref_store.h ('k') | base/prefs/json_pref_store.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/prefs/default_pref_store.cc
diff --git a/base/prefs/default_pref_store.cc b/base/prefs/default_pref_store.cc
index eb14a5043ebc9588093801f4945822b9987c3907..8e2644cc719125741d98023d45e816278318c9ec 100644
--- a/base/prefs/default_pref_store.cc
+++ b/base/prefs/default_pref_store.cc
@@ -9,25 +9,25 @@ using base::Value;
DefaultPrefStore::DefaultPrefStore() {}
-PrefStore::ReadResult DefaultPrefStore::GetValue(
+bool DefaultPrefStore::GetValue(
const std::string& key,
const base::Value** result) const {
- return prefs_.GetValue(key, result) ? READ_OK : READ_NO_VALUE;
+ return prefs_.GetValue(key, result);
}
void DefaultPrefStore::SetDefaultValue(const std::string& key, Value* value) {
- CHECK(GetValue(key, NULL) == READ_NO_VALUE);
+ DCHECK(!GetValue(key, NULL));
prefs_.SetValue(key, value);
}
void DefaultPrefStore::RemoveDefaultValue(const std::string& key) {
- CHECK(GetValue(key, NULL) == READ_OK);
+ DCHECK(GetValue(key, NULL));
prefs_.RemoveValue(key);
}
base::Value::Type DefaultPrefStore::GetType(const std::string& key) const {
- const Value* value;
- return GetValue(key, &value) == READ_OK ? value->GetType() : Value::TYPE_NULL;
+ const Value* value = NULL;
+ return GetValue(key, &value) ? value->GetType() : Value::TYPE_NULL;
}
DefaultPrefStore::const_iterator DefaultPrefStore::begin() const {
« no previous file with comments | « base/prefs/default_pref_store.h ('k') | base/prefs/json_pref_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698