| 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" |
| 12 | 14 |
| 15 class HashStoreContents; |
| 13 class InterceptablePrefFilter; | 16 class InterceptablePrefFilter; |
| 17 class PrefHashStore; |
| 14 | 18 |
| 15 // Sets up InterceptablePrefFilter::FilterOnLoadInterceptors on | 19 // Sets up InterceptablePrefFilter::FilterOnLoadInterceptors on |
| 16 // |unprotected_pref_filter| and |protected_pref_filter| which prevents each | 20 // |unprotected_pref_filter| and |protected_pref_filter| which prevents each |
| 17 // filter from running their on load operations until the interceptors decide to | 21 // filter from running their on load operations until the interceptors decide to |
| 18 // hand the prefs back to them (after migration is complete). | | 22 // hand the prefs back to them (after migration is complete). | |
| 19 // (un)protected_store_cleaner| and | 23 // (un)protected_store_cleaner| and |
| 20 // |register_on_successful_(un)protected_store_write_callback| are used to do | 24 // |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 | 25 // 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 | 26 // blocking shutdown. |(un)protected_pref_hash_store| and |
| 23 // (it will simply try again in the next Chrome run). | 27 // |legacy_pref_hash_store| are used to migrate MACs along with their protected |
| 28 // preferences and/or from the legacy location in Local State. Migrated MACs |
| 29 // will only be cleared from their old location in a subsequent run. The |
| 30 // migration framework is resilient to a failed cleanup (it will simply try |
| 31 // again in the next Chrome run). |
| 24 void SetupTrackedPreferencesMigration( | 32 void SetupTrackedPreferencesMigration( |
| 25 const std::set<std::string>& unprotected_pref_names, | 33 const std::set<std::string>& unprotected_pref_names, |
| 26 const std::set<std::string>& protected_pref_names, | 34 const std::set<std::string>& protected_pref_names, |
| 27 const base::Callback<void(const std::string& key)>& | 35 const base::Callback<void(const std::string& key)>& |
| 28 unprotected_store_cleaner, | 36 unprotected_store_cleaner, |
| 29 const base::Callback<void(const std::string& key)>& protected_store_cleaner, | 37 const base::Callback<void(const std::string& key)>& protected_store_cleaner, |
| 30 const base::Callback<void(const base::Closure&)>& | 38 const base::Callback<void(const base::Closure&)>& |
| 31 register_on_successful_unprotected_store_write_callback, | 39 register_on_successful_unprotected_store_write_callback, |
| 32 const base::Callback<void(const base::Closure&)>& | 40 const base::Callback<void(const base::Closure&)>& |
| 33 register_on_successful_protected_store_write_callback, | 41 register_on_successful_protected_store_write_callback, |
| 42 scoped_ptr<PrefHashStore> unprotected_pref_hash_store, |
| 43 scoped_ptr<PrefHashStore> protected_pref_hash_store, |
| 44 scoped_ptr<HashStoreContents> legacy_pref_hash_store, |
| 34 InterceptablePrefFilter* unprotected_pref_filter, | 45 InterceptablePrefFilter* unprotected_pref_filter, |
| 35 InterceptablePrefFilter* protected_pref_filter); | 46 InterceptablePrefFilter* protected_pref_filter); |
| 36 | 47 |
| 37 #endif // CHROME_BROWSER_PREFS_TRACKED_TRACKED_PREFERENCES_MIGRATION_H_ | 48 #endif // CHROME_BROWSER_PREFS_TRACKED_TRACKED_PREFERENCES_MIGRATION_H_ |
| OLD | NEW |