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

Unified Diff: base/prefs/json_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/json_pref_store.h ('k') | base/prefs/json_pref_store_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/prefs/json_pref_store.cc
diff --git a/base/prefs/json_pref_store.cc b/base/prefs/json_pref_store.cc
index 9e1e7774a64983af82fa90808b02db038e584171..04479753c3aad7b98e41370d09133d746e415d83 100644
--- a/base/prefs/json_pref_store.cc
+++ b/base/prefs/json_pref_store.cc
@@ -162,15 +162,15 @@ JsonPrefStore::JsonPrefStore(const FilePath& filename,
read_error_(PREF_READ_ERROR_OTHER) {
}
-PrefStore::ReadResult JsonPrefStore::GetValue(const std::string& key,
- const Value** result) const {
+bool JsonPrefStore::GetValue(const std::string& key,
+ const Value** result) const {
Value* tmp = NULL;
- if (prefs_->Get(key, &tmp)) {
- if (result)
- *result = tmp;
- return READ_OK;
- }
- return READ_NO_VALUE;
+ if (!prefs_->Get(key, &tmp))
+ return false;
+
+ if (result)
+ *result = tmp;
+ return true;
}
void JsonPrefStore::AddObserver(PrefStore::Observer* observer) {
@@ -189,9 +189,9 @@ bool JsonPrefStore::IsInitializationComplete() const {
return initialized_;
}
-PrefStore::ReadResult JsonPrefStore::GetMutableValue(const std::string& key,
- Value** result) {
- return prefs_->Get(key, result) ? READ_OK : READ_NO_VALUE;
+bool JsonPrefStore::GetMutableValue(const std::string& key,
+ Value** result) {
+ return prefs_->Get(key, result);
}
void JsonPrefStore::SetValue(const std::string& key, Value* value) {
« no previous file with comments | « base/prefs/json_pref_store.h ('k') | base/prefs/json_pref_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698