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

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

Issue 257003007: Introduce a new framework for back-and-forth tracked/protected preferences migration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment nit Created 6 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
« no previous file with comments | « base/prefs/pref_filter.h ('k') | chrome/browser/prefs/interceptable_pref_filter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/chrome_pref_service_factory.cc
diff --git a/chrome/browser/prefs/chrome_pref_service_factory.cc b/chrome/browser/prefs/chrome_pref_service_factory.cc
index 0f1d01be1e5e053e78ec0f8b460a1c1f1af6fe62..5546942d14b602f35060ff79ba30cc0f55bdd549 100644
--- a/chrome/browser/prefs/chrome_pref_service_factory.cc
+++ b/chrome/browser/prefs/chrome_pref_service_factory.cc
@@ -158,10 +158,25 @@ const PrefHashFilter::TrackedPreferenceMetadata kTrackedPrefs[] = {
PrefHashFilter::NO_ENFORCEMENT,
PrefHashFilter::TRACKING_STRATEGY_ATOMIC
},
+ {
+ // Protecting kPreferenceResetTime does two things:
+ // 1) It ensures this isn't accidently set by someone stomping the pref
+ // file.
+ // 2) More importantly, it declares kPreferenceResetTime as a protected
+ // pref which is required for it to be visible when queried via the
+ // SegregatedPrefStore. This is because it's written directly in the
+ // protected JsonPrefStore by that store's PrefHashFilter if there was
+ // a reset in FilterOnLoad and SegregatedPrefStore will not look for it
+ // in the protected JsonPrefStore unless it's declared as a protected
+ // preference here.
+ 15, prefs::kPreferenceResetTime,
+ PrefHashFilter::ENFORCE_ON_LOAD,
+ PrefHashFilter::TRACKING_STRATEGY_ATOMIC
+ },
};
// The count of tracked preferences IDs across all platforms.
-const size_t kTrackedPrefsReportingIDsCount = 15;
+const size_t kTrackedPrefsReportingIDsCount = 16;
COMPILE_ASSERT(kTrackedPrefsReportingIDsCount >= arraysize(kTrackedPrefs),
need_to_increment_ids_count);
« no previous file with comments | « base/prefs/pref_filter.h ('k') | chrome/browser/prefs/interceptable_pref_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698