| Index: services/preferences/public/interfaces/preferences.mojom
|
| diff --git a/services/preferences/public/interfaces/preferences.mojom b/services/preferences/public/interfaces/preferences.mojom
|
| index 2f6cfdd584d896c52673255cacae5a94b79b6db7..dc6f1df7b1aef0880b2a4180a260a36ecb1c7231 100644
|
| --- a/services/preferences/public/interfaces/preferences.mojom
|
| +++ b/services/preferences/public/interfaces/preferences.mojom
|
| @@ -4,7 +4,10 @@
|
|
|
| module prefs.mojom;
|
|
|
| +import "mojo/common/file_path.mojom";
|
| +import "mojo/common/string16.mojom";
|
| import "mojo/common/values.mojom";
|
| +import "services/preferences/public/interfaces/tracked_preference_validation_delegate.mojom";
|
|
|
| const string kServiceName = "preferences";
|
|
|
| @@ -91,3 +94,93 @@ interface PrefStoreConnector {
|
| // be received.
|
| Connect() => (map<PrefStoreType, PrefStoreConnection> connections);
|
| };
|
| +
|
| +// A persistent PrefStore. This
|
| +interface PersistentPrefStore {
|
| + // Null |value| indicates a delete. |flags| is a bitmask of
|
| + // WritablePrefStore::PrefWriteFlags.
|
| + SetValue(string key, mojo.common.mojom.Value? value, uint32 flags);
|
| +
|
| + CommitPendingWrite();
|
| + SchedulePendingLossyWrites();
|
| + ClearMutableValues();
|
| +};
|
| +
|
| +interface PersistentPrefStoreConnector {
|
| + enum ReadError {
|
| + NONE = 0,
|
| + JSON_PARSE = 1,
|
| + JSON_TYPE = 2,
|
| + ACCESS_DENIED = 3,
|
| + FILE_OTHER = 4,
|
| + FILE_LOCKED = 5,
|
| + NO_FILE = 6,
|
| + JSON_REPEAT = 7,
|
| + // OTHER = 8, // Deprecated.
|
| + FILE_NOT_SPECIFIED = 9,
|
| + ASYNCHRONOUS_TASK_INCOMPLETE = 10,
|
| + };
|
| +
|
| + // A null |preferences| indicates that the pref service failed to load prefs.
|
| + [Sync]
|
| + Connect() => (
|
| + ReadError read_error,
|
| + bool read_only,
|
| + mojo.common.mojom.DictionaryValue? preferences,
|
| + PersistentPrefStore? pref_store,
|
| + PrefStoreObserver&? observer);
|
| +};
|
| +
|
| +interface ResetOnLoadObserver {
|
| + OnResetOnLoad();
|
| +};
|
| +
|
| +interface PersistentPrefStoreInit {
|
| + Init(UserPrefsConfiguration configuration);
|
| +};
|
| +
|
| +union UserPrefsConfiguration {
|
| + SimpleUserPrefsConfiguration simple_configuration;
|
| + SegregatedUserPrefsConfiguration segregated_configuration;
|
| +};
|
| +
|
| +struct SimpleUserPrefsConfiguration {
|
| + mojo.common.mojom.FilePath pref_filename;
|
| +};
|
| +
|
| +struct SegregatedUserPrefsConfiguration {
|
| + mojo.common.mojom.FilePath unprotected_pref_filename;
|
| + mojo.common.mojom.FilePath protected_pref_filename;
|
| + array<TrackedPreferenceMetadata> tracking_configuration;
|
| + uint64 reporting_ids_count;
|
| + string seed;
|
| + string legacy_device_id;
|
| + mojo.common.mojom.String16 registry_path;
|
| + TrackedPreferenceValidationDelegate? validation_delegate;
|
| + ResetOnLoadObserver reset_on_load_observer;
|
| +};
|
| +
|
| +struct TrackedPreferenceMetadata {
|
| + enum EnforcementLevel { NO_ENFORCEMENT, ENFORCE_ON_LOAD };
|
| +
|
| + enum PrefTrackingStrategy {
|
| + // Atomic preferences are tracked as a whole.
|
| + ATOMIC,
|
| + // Split preferences are dictionaries for which each top-level entry is
|
| + // tracked independently. Note: preferences using this strategy must be kept
|
| + // in sync with TrackedSplitPreferences in histograms.xml.
|
| + SPLIT,
|
| + };
|
| +
|
| + enum ValueType {
|
| + IMPERSONAL,
|
| + // The preference value may contain personal information.
|
| + PERSONAL,
|
| + };
|
| +
|
| + uint64 reporting_id;
|
| + string name;
|
| + EnforcementLevel enforcement_level;
|
| + PrefTrackingStrategy strategy;
|
| + ValueType value_type;
|
| +};
|
|
|