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

Unified Diff: chrome/browser/prefs/pref_value_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 | « chrome/browser/prefs/pref_service.cc ('k') | chrome/browser/sync/credential_cache_service_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/pref_value_store.cc
diff --git a/chrome/browser/prefs/pref_value_store.cc b/chrome/browser/prefs/pref_value_store.cc
index b023d8b3053e03a0e28304fe6b8fa504d4413be2..7797077ee38a8b791c9c6dc28085131e3ca83cbb 100644
--- a/chrome/browser/prefs/pref_value_store.cc
+++ b/chrome/browser/prefs/pref_value_store.cc
@@ -214,23 +214,11 @@ bool PrefValueStore::GetValueFromStore(const char* name,
// Only return true if we find a value and it is the correct type, so stale
// values with the incorrect type will be ignored.
const PrefStore* store = GetPrefStore(static_cast<PrefStoreType>(store_type));
- if (store) {
- switch (store->GetValue(name, out_value)) {
- case PrefStore::READ_USE_DEFAULT:
- store = GetPrefStore(DEFAULT_STORE);
- if (!store || store->GetValue(name, out_value) != PrefStore::READ_OK) {
- *out_value = NULL;
- return false;
- }
- // Fall through...
- case PrefStore::READ_OK:
- return true;
- case PrefStore::READ_NO_VALUE:
- break;
- }
- }
+ if (store && store->GetValue(name, out_value))
+ return true;
- // No valid value found for the given preference name: set the return false.
+ // No valid value found for the given preference name: set the return value
+ // to false.
*out_value = NULL;
return false;
}
« no previous file with comments | « chrome/browser/prefs/pref_service.cc ('k') | chrome/browser/sync/credential_cache_service_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698