OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_PREFS_TRACKED_TRACKED_PREFERENCES_MIGRATION_H_ | 5 #ifndef CHROME_BROWSER_PREFS_TRACKED_TRACKED_PREFERENCES_MIGRATION_H_ |
6 #define CHROME_BROWSER_PREFS_TRACKED_TRACKED_PREFERENCES_MIGRATION_H_ | 6 #define CHROME_BROWSER_PREFS_TRACKED_TRACKED_PREFERENCES_MIGRATION_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "chrome/browser/prefs/pref_hash_store.h" |
| 14 #include "chrome/browser/prefs/tracked/hash_store_contents.h" |
12 | 15 |
13 class InterceptablePrefFilter; | 16 class InterceptablePrefFilter; |
14 | 17 |
15 // Sets up InterceptablePrefFilter::FilterOnLoadInterceptors on | 18 // Sets up InterceptablePrefFilter::FilterOnLoadInterceptors on |
16 // |unprotected_pref_filter| and |protected_pref_filter| which prevents each | 19 // |unprotected_pref_filter| and |protected_pref_filter| which prevents each |
17 // filter from running their on load operations until the interceptors decide to | 20 // filter from running their on load operations until the interceptors decide to |
18 // hand the prefs back to them (after migration is complete). | | 21 // hand the prefs back to them (after migration is complete). | |
19 // (un)protected_store_cleaner| and | 22 // (un)protected_store_cleaner| and |
20 // |register_on_successful_(un)protected_store_write_callback| are used to do | 23 // |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 | 24 // 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 | 25 // blocking shutdown. The migration framework is resilient to a failed cleanup |
23 // (it will simply try again in the next Chrome run). | 26 // (it will simply try again in the next Chrome run). |
24 void SetupTrackedPreferencesMigration( | 27 void SetupTrackedPreferencesMigration( |
25 const std::set<std::string>& unprotected_pref_names, | 28 const std::set<std::string>& unprotected_pref_names, |
26 const std::set<std::string>& protected_pref_names, | 29 const std::set<std::string>& protected_pref_names, |
27 const base::Callback<void(const std::string& key)>& | 30 const base::Callback<void(const std::string& key)>& |
28 unprotected_store_cleaner, | 31 unprotected_store_cleaner, |
29 const base::Callback<void(const std::string& key)>& protected_store_cleaner, | 32 const base::Callback<void(const std::string& key)>& protected_store_cleaner, |
30 const base::Callback<void(const base::Closure&)>& | 33 const base::Callback<void(const base::Closure&)>& |
31 register_on_successful_unprotected_store_write_callback, | 34 register_on_successful_unprotected_store_write_callback, |
32 const base::Callback<void(const base::Closure&)>& | 35 const base::Callback<void(const base::Closure&)>& |
33 register_on_successful_protected_store_write_callback, | 36 register_on_successful_protected_store_write_callback, |
| 37 scoped_ptr<PrefHashStore> unprotected_pref_hash_store, |
| 38 scoped_ptr<PrefHashStore> protected_pref_hash_store, |
| 39 scoped_ptr<HashStoreContents> legacy_pref_hash_store, |
34 InterceptablePrefFilter* unprotected_pref_filter, | 40 InterceptablePrefFilter* unprotected_pref_filter, |
35 InterceptablePrefFilter* protected_pref_filter); | 41 InterceptablePrefFilter* protected_pref_filter); |
36 | 42 |
37 #endif // CHROME_BROWSER_PREFS_TRACKED_TRACKED_PREFERENCES_MIGRATION_H_ | 43 #endif // CHROME_BROWSER_PREFS_TRACKED_TRACKED_PREFERENCES_MIGRATION_H_ |
OLD | NEW |