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); |
} |