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

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
Index: base/prefs/json_pref_store.cc
diff --git a/base/prefs/json_pref_store.cc b/base/prefs/json_pref_store.cc
index 18dc0b76c1ff50ce1c5c168abaea827c492613c8..6b9b4994497ca53e2fd287ec99579ece2d7f3df8 100644
--- a/base/prefs/json_pref_store.cc
+++ b/base/prefs/json_pref_store.cc
@@ -149,15 +149,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) {
@@ -176,9 +176,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) {

Powered by Google App Engine
This is Rietveld 408576698