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

Unified Diff: services/preferences/tracked/pref_hash_filter.cc

Issue 2905903002: Delete the PreferenceMACs on profile deletion. (Closed)
Patch Set: Created 3 years, 7 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
Index: services/preferences/tracked/pref_hash_filter.cc
diff --git a/services/preferences/tracked/pref_hash_filter.cc b/services/preferences/tracked/pref_hash_filter.cc
index 29d6b9ab830891d3388ed91e6c14957deed32465..578901297d080d3df173052388acd8a2c33352e9 100644
--- a/services/preferences/tracked/pref_hash_filter.cc
+++ b/services/preferences/tracked/pref_hash_filter.cc
@@ -201,6 +201,16 @@ PrefFilter::OnWriteCallbackPair PrefHashFilter::FilterSerializeData(
return callback_pair;
}
+void PrefHashFilter::CleanupForProfileDeletion() {
+ if (external_validation_hash_store_pair_) {
+ external_validation_hash_store_pair_->second.get()->Reset();
+
+ // The PrefStore will attempt to flush the preferences of a deleted profile.
+ // Clear the external store pair to avoid re-writing to it.
+ external_validation_hash_store_pair_.reset();
+ }
+}
+
void PrefHashFilter::FinalizeFilterOnLoad(
const PostFilterOnLoadCallback& post_filter_on_load_callback,
std::unique_ptr<base::DictionaryValue> pref_store_contents,

Powered by Google App Engine
This is Rietveld 408576698