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

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

Issue 324493002: Move preference MACs to the protected preference stores. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pull some stuff from Persistent to WriteablePrefStore. Created 6 years, 6 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/tracked/tracked_preferences_migration.h
diff --git a/chrome/browser/prefs/tracked/tracked_preferences_migration.h b/chrome/browser/prefs/tracked/tracked_preferences_migration.h
index 348f844cc00a7bb0ee62c5b5ac80367a830d3fe4..b498ff286f96e4745b93bb418020587974c8cf08 100644
--- a/chrome/browser/prefs/tracked/tracked_preferences_migration.h
+++ b/chrome/browser/prefs/tracked/tracked_preferences_migration.h
@@ -9,8 +9,33 @@
#include <string>
#include "base/callback_forward.h"
+#include "base/memory/scoped_ptr.h"
-class InterceptablePrefFilter;
+namespace base {
+class DictionaryValue;
+} // namespace base
+
+class PrefHashStore;
+
+class TrackedPreferencesMigrationDelegate {
gab 2014/06/06 21:55:00 As mentioned before, I agree that this delegate ma
erikwright (departed) 2014/06/10 20:27:48 I found it preferable to adding an additional two
gab 2014/06/11 18:23:55 Agreed, except that for the sake of simplicity on
+ public:
+ virtual ~TrackedPreferencesMigrationDelegate() {}
+
+ typedef base::Callback<void(bool prefs_altered)> InterceptCompletionCallback;
+
+ // A callback to be invoked from FilterOnLoad. It takes ownership of prefs
+ // and may modify them before handing them back to this
+ // InterceptablePrefFilter via |finalize_filter_on_load|.
+ typedef base::Callback<
+ void(const InterceptCompletionCallback& completion_callback,
+ base::DictionaryValue* prefs)> Intercept;
+
+ virtual void CleanPreference(const std::string& key) = 0;
+ virtual void NotifyOnSuccessfulWrite(
+ const base::Closure& on_successful_write) = 0;
+ virtual void InterceptLoadedPreferences(const Intercept& intercept) = 0;
+ virtual PrefHashStore* GetPrefHashStore() = 0;
+};
// Sets up InterceptablePrefFilter::FilterOnLoadInterceptors on
// |unprotected_pref_filter| and |protected_pref_filter| which prevents each
@@ -24,14 +49,8 @@ class InterceptablePrefFilter;
void SetupTrackedPreferencesMigration(
const std::set<std::string>& unprotected_pref_names,
const std::set<std::string>& protected_pref_names,
- const base::Callback<void(const std::string& key)>&
- unprotected_store_cleaner,
- const base::Callback<void(const std::string& key)>& protected_store_cleaner,
- const base::Callback<void(const base::Closure&)>&
- register_on_successful_unprotected_store_write_callback,
- const base::Callback<void(const base::Closure&)>&
- register_on_successful_protected_store_write_callback,
- InterceptablePrefFilter* unprotected_pref_filter,
- InterceptablePrefFilter* protected_pref_filter);
+ scoped_ptr<TrackedPreferencesMigrationDelegate> unprotected_delegate,
+ scoped_ptr<TrackedPreferencesMigrationDelegate> protected_delegate,
+ scoped_ptr<PrefHashStore> legacy_pref_hash_store);
#endif // CHROME_BROWSER_PREFS_TRACKED_TRACKED_PREFERENCES_MIGRATION_H_

Powered by Google App Engine
This is Rietveld 408576698