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

Unified Diff: services/preferences/public/interfaces/preferences.mojom

Issue 2092453002: Mojom interface for Preferences (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Review Comments Created 4 years, 5 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: services/preferences/public/interfaces/preferences.mojom
diff --git a/services/preferences/public/interfaces/preferences.mojom b/services/preferences/public/interfaces/preferences.mojom
new file mode 100644
index 0000000000000000000000000000000000000000..a3e4f0c11c3bb5f2d8ff982cccbba6c85c32e890
--- /dev/null
+++ b/services/preferences/public/interfaces/preferences.mojom
@@ -0,0 +1,39 @@
+// Copyright 2016 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.
+
+module prefs.mojom;
+
+// A Preference could be one of several base types. PrefStore utilizes
+// base::Value to encompass these. TODO(jonross): create struct traits so that
+// we can pass base::Value via mojo.
+struct Preference {
+ enum PreferenceType { INT, STRING };
+
+ PreferenceType type;
+ uint32 integer_value_;
+ string? string_value_;
+};
+
+// A list of preference keys.
+struct PreferenceList {
+ array<string> preferences;
+};
sadrul 2016/07/25 15:32:18 Do you need this if you use use_new_wrapper_types?
jonross 2016/07/26 19:27:37 Done.
+
+// A key-value mapping of preferences.
+struct PreferenceMap {
+ map<string, Preference> preferences;
+};
sadrul 2016/07/25 15:32:18 ditto
jonross 2016/07/26 19:27:36 Done.
+
+// Used to subscribe to preference changes within PreferenceManager. After
+// requesting to observe, the current values for all requested keys are sent.
+interface PreferenceObserver {
+ OnPreferencesChanged(PreferenceMap preferences);
+};
+
+// Manages actual read/write of preference data. Accepts observers who subscribe
+// to preferences, notifying them of changes.
+interface PreferenceManager {
+ AddObserver(PreferenceList preferences, PreferenceObserver client);
+ SetPreferences(PreferenceMap preferences);
+};

Powered by Google App Engine
This is Rietveld 408576698