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

Unified 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: Created 6 years, 8 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
new file mode 100644
index 0000000000000000000000000000000000000000..2586f6e49b3c7bd32f05a50114235d7ecbdaae83
--- /dev/null
+++ b/chrome/browser/prefs/tracked/tracked_preferences_migration.h
@@ -0,0 +1,28 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_PREFS_TRACKED_TRACKED_PREFERENCES_MIGRATION_H_
+#define CHROME_BROWSER_PREFS_TRACKED_TRACKED_PREFERENCES_MIGRATION_H_
+
+#include <set>
+#include <string>
+
+class JsonPrefStore;
+
+// Sets up JsonPrefStore::OnFileReadInterceptors on |unprotected_pref_store|
+// and |protected_pref_store| such that they are only handed back to their
+// respective JsonPrefStores on read after we've made sure that the most recent
+// pref value for |unprotected_pref_names| are in the |unprotected_pref_store|
+// and conversely for protected preferences.
+// NOTE: In the event of a synchronous read request (i.e.,
+// JsonPrefStore::ReadPrefs()): the JsonPrefStore::OnFileReadInterceptors will
+// make the first read asynchronous, but the double read will complete
+// synchronously on the second ReadPrefs().
+void SetupTrackedPrefererencesMigration(
Bernhard Bauer 2014/04/29 15:13:04 There's one "re" too much in there :)
gab 2014/04/29 15:46:44 Haha, good catch, introducing some rimes in the tr
+ const std::set<std::string>& unprotected_pref_names,
+ const std::set<std::string>& protected_pref_names,
+ JsonPrefStore* unprotected_pref_store,
+ JsonPrefStore* protected_pref_store);
+
+#endif // CHROME_BROWSER_PREFS_TRACKED_TRACKED_PREFERENCES_MIGRATION_H_

Powered by Google App Engine
This is Rietveld 408576698