Temporarily re-enabling SizeAfterPrefChange test with traces (this time for Linux...
[chromium-blink-merge.git] / chrome / browser / prefs / tracked / tracked_preferences_migration.h
blob348f844cc00a7bb0ee62c5b5ac80367a830d3fe4
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.
5 #ifndef CHROME_BROWSER_PREFS_TRACKED_TRACKED_PREFERENCES_MIGRATION_H_
6 #define CHROME_BROWSER_PREFS_TRACKED_TRACKED_PREFERENCES_MIGRATION_H_
8 #include <set>
9 #include <string>
11 #include "base/callback_forward.h"
13 class InterceptablePrefFilter;
15 // Sets up InterceptablePrefFilter::FilterOnLoadInterceptors on
16 // |unprotected_pref_filter| and |protected_pref_filter| which prevents each
17 // filter from running their on load operations until the interceptors decide to
18 // hand the prefs back to them (after migration is complete). |
19 // (un)protected_store_cleaner| and
20 // |register_on_successful_(un)protected_store_write_callback| are used to do
21 // post-migration cleanup tasks. Those should be bound to weak pointers to avoid
22 // blocking shutdown. The migration framework is resilient to a failed cleanup
23 // (it will simply try again in the next Chrome run).
24 void SetupTrackedPreferencesMigration(
25 const std::set<std::string>& unprotected_pref_names,
26 const std::set<std::string>& protected_pref_names,
27 const base::Callback<void(const std::string& key)>&
28 unprotected_store_cleaner,
29 const base::Callback<void(const std::string& key)>& protected_store_cleaner,
30 const base::Callback<void(const base::Closure&)>&
31 register_on_successful_unprotected_store_write_callback,
32 const base::Callback<void(const base::Closure&)>&
33 register_on_successful_protected_store_write_callback,
34 InterceptablePrefFilter* unprotected_pref_filter,
35 InterceptablePrefFilter* protected_pref_filter);
37 #endif // CHROME_BROWSER_PREFS_TRACKED_TRACKED_PREFERENCES_MIGRATION_H_