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

Unified Diff: chrome/browser/prefs/tracked/tracked_preferences_migration.cc

Issue 560393003: Do not allow values to be migrated without MACs if the destination already has a MAC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2062_120
Patch Set: Created 6 years, 3 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/tracked/tracked_preferences_migration.cc
diff --git a/chrome/browser/prefs/tracked/tracked_preferences_migration.cc b/chrome/browser/prefs/tracked/tracked_preferences_migration.cc
index 382c924bfea130bf7ea6b07235ef2beb53254a7f..0d4701a6e8a3e06a469a6d016b24fe0156618fb0 100644
--- a/chrome/browser/prefs/tracked/tracked_preferences_migration.cc
+++ b/chrome/browser/prefs/tracked/tracked_preferences_migration.cc
@@ -192,7 +192,12 @@ void MigratePrefsFromOldToNewStore(const std::set<std::string>& pref_names,
new_hash_store_transaction->ImportHash(pref_name, old_hash);
*new_store_altered = true;
} else if (!destination_hash_missing) {
- new_hash_store_transaction->ClearHash(pref_name);
+ // Do not allow values to be migrated without MACs if the destination
+ // already has a MAC (http://crbug.com/414554). Remove the migrated
+ // value in order to provide the same no-op behaviour as if the pref was
+ // added to the wrong file when there was already a value for
+ // |pref_name| in |new_store|.
+ new_store->Remove(pref_name, NULL);
*new_store_altered = true;
}
}
« 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