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

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

Issue 2856083002: Pref service: support for incognito prefs (Closed)
Patch Set: Rebase Created 3 years, 7 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
index ca3f37ad114dbc41a839434085cde7e2ba5a6492..5a8c0c529d169bab4880296766cb9621756390c7 100644
--- a/services/preferences/public/interfaces/preferences.mojom
+++ b/services/preferences/public/interfaces/preferences.mojom
@@ -4,8 +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/preferences_configuration.mojom";
+import "services/preferences/public/interfaces/tracked_preference_validation_delegate.mojom";
const string kServiceName = "preferences";
const string kForwarderServiceName = "preferences_forwarder";
@@ -18,6 +20,7 @@ enum PrefStoreType {
SUPERVISED_USER,
EXTENSION,
COMMAND_LINE,
+ INCOGNITO,
USER,
RECOMMENDED,
DEFAULT,
@@ -97,6 +100,9 @@ interface PrefStoreConnector {
array<PrefStoreType> already_connected_types) =>
(PersistentPrefStoreConnection connection,
map<PrefStoreType, PrefStoreConnection> connections);
+
+ // Connect to a read-only view of the user pref store. Used for incognito.
+ ConnectToUserPrefStore(PrefStore& request);
};
// An update to a subcomponent of a pref.
@@ -155,3 +161,66 @@ interface PrefServiceControl {
// be used.
Init(PersistentPrefStoreConfiguration configuration);
};
+
+// ---------------------------------------------------------------------
+// Service Configuration
+
+union PersistentPrefStoreConfiguration {
+ SimplePersistentPrefStoreConfiguration simple_configuration;
+ TrackedPersistentPrefStoreConfiguration tracked_configuration;
+ IncognitoPersistentPrefStoreConfiguration incognito_configuration;
+};
+
+struct SimplePersistentPrefStoreConfiguration {
+ mojo.common.mojom.FilePath pref_filename;
+};
+
+// These parameters are passed to prefs::CreateTrackedPersistentPrefStore() in
+// services/preferences/persistent_pref_store_factory.cc.
+struct TrackedPersistentPrefStoreConfiguration {
+ 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;
+ string registry_seed;
+ 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;
+};
+
+interface ResetOnLoadObserver {
+ OnResetOnLoad();
+};
+
+struct IncognitoPersistentPrefStoreConfiguration {
+ // A connector for the underlying user's prefs. Used to serve that user's
+ // prefs in a read-only fashion.
+ PrefStoreConnector connector;
+};

Powered by Google App Engine
This is Rietveld 408576698