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

Unified Diff: base/prefs/overlay_user_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/overlay_user_pref_store.cc
diff --git a/base/prefs/overlay_user_pref_store.cc b/base/prefs/overlay_user_pref_store.cc
index 26ee45e230fd9d7582cf8fa9754b620ae03221f3..3a74a5c4a6c174886d1c977c2c117b754ea0633a 100644
--- a/base/prefs/overlay_user_pref_store.cc
+++ b/base/prefs/overlay_user_pref_store.cc
@@ -33,41 +33,37 @@ bool OverlayUserPrefStore::IsInitializationComplete() const {
return underlay_->IsInitializationComplete();
}
-PrefStore::ReadResult OverlayUserPrefStore::GetValue(
- const std::string& key,
- const Value** result) const {
+bool OverlayUserPrefStore::GetValue(const std::string& key,
+ const Value** result) const {
// If the |key| shall NOT be stored in the overlay store, there must not
// be an entry.
DCHECK(ShallBeStoredInOverlay(key) || !overlay_.GetValue(key, NULL));
if (overlay_.GetValue(key, result))
- return READ_OK;
+ return true;
return underlay_->GetValue(GetUnderlayKey(key), result);
}
-PrefStore::ReadResult OverlayUserPrefStore::GetMutableValue(
- const std::string& key,
- Value** result) {
+bool OverlayUserPrefStore::GetMutableValue(const std::string& key,
+ Value** result) {
if (!ShallBeStoredInOverlay(key))
return underlay_->GetMutableValue(GetUnderlayKey(key), result);
if (overlay_.GetValue(key, result))
- return READ_OK;
+ return true;
// Try to create copy of underlay if the overlay does not contain a value.
Value* underlay_value = NULL;
- PrefStore::ReadResult read_result =
- underlay_->GetMutableValue(GetUnderlayKey(key), &underlay_value);
- if (read_result != READ_OK)
- return read_result;
+ if (!underlay_->GetMutableValue(GetUnderlayKey(key), &underlay_value))
+ return false;
*result = underlay_value->DeepCopy();
overlay_.SetValue(key, *result);
- return READ_OK;
+ return true;
}
void OverlayUserPrefStore::SetValue(const std::string& key,
- Value* value) {
+ Value* value) {
if (!ShallBeStoredInOverlay(key)) {
underlay_->SetValue(GetUnderlayKey(key), value);
return;
@@ -78,7 +74,7 @@ void OverlayUserPrefStore::SetValue(const std::string& key,
}
void OverlayUserPrefStore::SetValueSilently(const std::string& key,
- Value* value) {
+ Value* value) {
if (!ShallBeStoredInOverlay(key)) {
underlay_->SetValueSilently(GetUnderlayKey(key), value);
return;

Powered by Google App Engine
This is Rietveld 408576698