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

Side by Side Diff: chrome/browser/prefs/tracked/tracked_preferences_migration.h

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: fix some tests -- more to come 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_PREFS_TRACKED_TRACKED_PREFERENCES_MIGRATION_H_
6 #define CHROME_BROWSER_PREFS_TRACKED_TRACKED_PREFERENCES_MIGRATION_H_
7
8 #include <set>
9 #include <string>
10
11 #include "base/callback_forward.h"
12
13 class PrefHashFilter;
14
15 // Sets up PrefHashFilter::FilterOnLoadInterceptors on |unprotected_pref_filter|
16 // and |protected_pref_filter| which prevents each filter from running their on
17 // load operations until the interceptors decide to hand the prefs back to them
18 // (after migration is complete). |(un)protected_store_cleaner| and
19 // |register_on_successful_(un)protected_store_write_callback| are used to do
20 // post-migration cleanup tasks. Those should be bound to weak pointers to avoid
21 // blocking shutdown. The migration framework is resilient to a failed cleanup
22 // (it will simply try again in the next Chrome run).
23 void SetupTrackedPreferencesMigration(
24 const std::set<std::string>& unprotected_pref_names,
25 const std::set<std::string>& protected_pref_names,
26 const base::Callback<void(const std::string& key)>&
27 unprotected_store_cleaner,
28 const base::Callback<void(const std::string& key)>& protected_store_cleaner,
29 const base::Callback<void(const base::Closure&)>&
30 register_on_successful_unprotected_store_write_callback,
31 const base::Callback<void(const base::Closure&)>&
32 register_on_successful_protected_store_write_callback,
33 PrefHashFilter* unprotected_pref_hash_filter,
34 PrefHashFilter* protected_pref_hash_filter);
35
36 #endif // CHROME_BROWSER_PREFS_TRACKED_TRACKED_PREFERENCES_MIGRATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698