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

Unified Diff: chrome/service/service_process_prefs.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 | « chrome/browser/sync/credential_cache_service_win.cc ('k') | chrome/test/base/testing_pref_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/service/service_process_prefs.cc
diff --git a/chrome/service/service_process_prefs.cc b/chrome/service/service_process_prefs.cc
index e417988be8eaa6a02bbffc5afe91a8bb2db3bd09..71b74fe8bd8d99967294d0a16022a34b85207753 100644
--- a/chrome/service/service_process_prefs.cc
+++ b/chrome/service/service_process_prefs.cc
@@ -28,10 +28,9 @@ std::string ServiceProcessPrefs::GetString(
const std::string& default_value) const {
const Value* value;
std::string result;
- if (prefs_->GetValue(key, &value) != PersistentPrefStore::READ_OK ||
- !value->GetAsString(&result)) {
+ if (!prefs_->GetValue(key, &value) || !value->GetAsString(&result))
return default_value;
- }
+
return result;
}
@@ -44,10 +43,9 @@ bool ServiceProcessPrefs::GetBoolean(const std::string& key,
bool default_value) const {
const Value* value;
bool result = false;
- if (prefs_->GetValue(key, &value) != PersistentPrefStore::READ_OK ||
- !value->GetAsBoolean(&result)) {
+ if (!prefs_->GetValue(key, &value) || !value->GetAsBoolean(&result))
return default_value;
- }
+
return result;
}
@@ -59,10 +57,9 @@ int ServiceProcessPrefs::GetInt(const std::string& key,
int default_value) const {
const Value* value;
int result = default_value;
- if (prefs_->GetValue(key, &value) != PersistentPrefStore::READ_OK ||
- !value->GetAsInteger(&result)) {
+ if (!prefs_->GetValue(key, &value) || !value->GetAsInteger(&result))
return default_value;
- }
+
return result;
}
@@ -73,7 +70,7 @@ void ServiceProcessPrefs::SetInt(const std::string& key, int value) {
const DictionaryValue* ServiceProcessPrefs::GetDictionary(
const std::string& key) const {
const Value* value;
- if (prefs_->GetValue(key, &value) != PersistentPrefStore::READ_OK ||
+ if (!prefs_->GetValue(key, &value) ||
!value->IsType(Value::TYPE_DICTIONARY)) {
return NULL;
}
@@ -84,10 +81,8 @@ const DictionaryValue* ServiceProcessPrefs::GetDictionary(
const base::ListValue* ServiceProcessPrefs::GetList(
const std::string& key) const {
const Value* value;
- if (prefs_->GetValue(key, &value) != PersistentPrefStore::READ_OK ||
- !value->IsType(Value::TYPE_LIST)) {
- return NULL;
- }
+ if (!prefs_->GetValue(key, &value) || !value->IsType(Value::TYPE_LIST))
+ return NULL;
return static_cast<const ListValue*>(value);
}
« no previous file with comments | « chrome/browser/sync/credential_cache_service_win.cc ('k') | chrome/test/base/testing_pref_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698