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

Unified Diff: chrome/browser/prefs/pref_value_store.cc

Issue 6357019: PrefValueStore incorrectly DCHECK()s when handling change notification for unregistered pref. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 months 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 | « no previous file | no next file » | 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 c86accdb58395edbd2bc1da7118a9f5b178507b6..c16491ef38a9d83a902105d8d156b67a5dda5268 100644
--- a/chrome/browser/prefs/pref_value_store.cc
+++ b/chrome/browser/prefs/pref_value_store.cc
@@ -117,21 +117,10 @@ void PrefValueStore::NotifyPrefChanged(
PrefValueStore::PrefStoreType new_store) {
DCHECK(new_store != INVALID_STORE);
- bool changed = true;
- // Replying that the pref has changed in case the new store is invalid may
- // cause problems, but it's the safer choice.
- if (new_store != INVALID_STORE) {
- PrefStoreType controller = ControllingPrefStoreForPref(path);
- DCHECK(controller != INVALID_STORE);
- // If the pref is controlled by a higher-priority store, its effective value
- // cannot have changed.
- if (controller != INVALID_STORE &&
- controller < new_store) {
- changed = false;
- }
- }
-
- if (changed)
+ // If the pref is controlled by a higher-priority store, its effective value
+ // cannot have changed.
+ PrefStoreType controller = ControllingPrefStoreForPref(path);
+ if (controller == INVALID_STORE || controller >= new_store)
pref_notifier_->OnPreferenceChanged(path);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698