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

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

Issue 205813002: Separate storage for protected preferences into Protected Preferences file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pp4_profile_pref_store
Patch Set: Revert code that breaks tests, commit what works. Created 6 years, 9 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: chrome/browser/prefs/profile_pref_store_manager.cc
diff --git a/chrome/browser/prefs/profile_pref_store_manager.cc b/chrome/browser/prefs/profile_pref_store_manager.cc
index 019b9306465f69be0aad5542f66da33cb0ae81f8..fc350a04902b467d889d39525de8ece17c21cc98 100644
--- a/chrome/browser/prefs/profile_pref_store_manager.cc
+++ b/chrome/browser/prefs/profile_pref_store_manager.cc
@@ -158,11 +158,24 @@ void ProfilePrefStoreManager::ResetAllPrefHashStores(PrefService* local_state) {
// static
base::Time ProfilePrefStoreManager::GetResetTime(PrefService* pref_service) {
+ // It's a bit of a coincidence that this (and ClearResetTime) work(s). The
gab 2014/04/01 18:55:06 :( -- to avoid all of this madness how about we us
erikwright (departed) 2014/04/01 19:46:08 The current implementation is cleaner, easier to u
gab 2014/04/02 17:02:03 Okay, makes sense, I agree with you now that I und
+ // PrefHashFilter attached to the protected pref store will store the reset
+ // time directly in the protected pref store without going through the
+ // SegregatedPrefStore.
+
+ // PrefHashFilter::GetResetTime will read the value through the pref service,
+ // and thus through the SegregatedPrefStore. Even though it's not listed as
+ // "protected" it will be read from the protected store prefentially to the
gab 2014/04/01 18:55:06 s/prefentially/preferentially
+ // (NULL) value in the unprotected pref store.
return PrefHashFilter::GetResetTime(pref_service);
}
// static
void ProfilePrefStoreManager::ClearResetTime(PrefService* pref_service) {
+ // PrefHashFilter::ClearResetTime will clear the value through the pref
+ // service, and thus through the SegregatedPrefStore. Since it's not listed as
+ // "protected" it will be migrated from the protected store to the unprotected
+ // pref store before being deleted from the latter.
PrefHashFilter::ClearResetTime(pref_service);
}

Powered by Google App Engine
This is Rietveld 408576698