From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- third_party/rust/tabs/src/tabs.udl | 108 +++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 third_party/rust/tabs/src/tabs.udl (limited to 'third_party/rust/tabs/src/tabs.udl') diff --git a/third_party/rust/tabs/src/tabs.udl b/third_party/rust/tabs/src/tabs.udl new file mode 100644 index 0000000000..d1964ea0d2 --- /dev/null +++ b/third_party/rust/tabs/src/tabs.udl @@ -0,0 +1,108 @@ +[Custom] +typedef string TabsGuid; + +namespace tabs { + +}; + +[Error] +interface TabsApiError { + SyncError(string reason); + SqlError(string reason); + UnexpectedTabsError(string reason); +}; + + +interface TabsStore { + constructor(string path); + + sequence get_all(); + + void set_local_tabs(sequence remote_tabs); + + [Self=ByArc] + void register_with_sync_manager(); + + [Throws=TabsApiError, Self=ByArc] + void reset(); + + [Throws=TabsApiError, Self=ByArc] + string sync(string key_id, string access_token, string sync_key, string tokenserver_url, string local_id); + + [Self=ByArc] + TabsBridgedEngine bridged_engine(); + +}; + +// Note that this enum is duplicated in fxa-client.udl (although the underlying type *is* +// shared). This duplication exists because there's no direct dependency between that crate and +// this one. We can probably remove the duplication when sync15 gets a .udl file, then we could +// reference it via an `[Extern=...]typedef` +enum TabsDeviceType { "Desktop", "Mobile", "Tablet", "VR", "TV", "Unknown" }; + +dictionary RemoteTabRecord { + string title; + sequence url_history; + string? icon; + // Number of ms since the unix epoch (as reported by the client's clock) + i64 last_used; +}; + +dictionary ClientRemoteTabs { + string client_id; + string client_name; + TabsDeviceType device_type; + // Number of ms since the unix epoch (as reported by the server's clock) + i64 last_modified; + sequence remote_tabs; +}; + +// Note the canonical docs for this are in https://searchfox.org/mozilla-central/source/services/interfaces/mozIBridgedSyncEngine.idl +// It's only actually used in desktop, but it's fine to expose this everywhere. +// NOTE: all timestamps here are milliseconds. +interface TabsBridgedEngine { + //readonly attribute long storageVersion; + // readonly attribute boolean allowSkippedRecord; + + // XXX - better logging story than this? + // attribute mozIServicesLogSink logger; + + [Throws=TabsApiError] + i64 last_sync(); + + [Throws=TabsApiError] + void set_last_sync(i64 last_sync); + + [Throws=TabsApiError] + string? sync_id(); + + [Throws=TabsApiError] + string reset_sync_id(); + + [Throws=TabsApiError] + string ensure_current_sync_id([ByRef]string new_sync_id); + + [Throws=TabsApiError] + void prepare_for_sync([ByRef]string client_data); + + [Throws=TabsApiError] + void sync_started(); + + [Throws=TabsApiError] + void store_incoming(sequence incoming_envelopes_as_json); + + [Throws=TabsApiError] + sequence apply(); + + [Throws=TabsApiError] + void set_uploaded(i64 new_timestamp, sequence uploaded_ids); + + [Throws=TabsApiError] + void sync_finished(); + + [Throws=TabsApiError] + void reset(); + + [Throws=TabsApiError] + void wipe(); +}; -- cgit v1.2.3