aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_traits/script_msg.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script_traits/script_msg.rs')
-rw-r--r--components/script_traits/script_msg.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/components/script_traits/script_msg.rs b/components/script_traits/script_msg.rs
index b1a9f2e6a52..446aa1b186b 100644
--- a/components/script_traits/script_msg.rs
+++ b/components/script_traits/script_msg.rs
@@ -135,6 +135,9 @@ pub enum ScriptMsg {
LogEntry(Option<PipelineId>, Option<String>, LogEntry),
/// Notifies the constellation that this pipeline has exited.
PipelineExited(PipelineId),
+ /// Send messages from postMessage calls from serviceworker
+ /// to constellation for storing in service worker manager
+ ForwardDOMMessage(DOMMessage, Url),
/// Store the data required to activate a service worker for the given scope
RegisterServiceWorker(ScopeThings, Url),
/// Requests that the compositor shut down.
@@ -159,8 +162,8 @@ pub struct ScopeThings {
}
/// Message that gets passed to service worker scope on postMessage
-#[derive(Deserialize, Serialize, Debug)]
-pub struct DOMMessage(pub Vec<u64>);
+#[derive(Deserialize, Serialize, Debug, Clone)]
+pub struct DOMMessage(pub Vec<u8>);
/// Channels to allow service worker manager to communicate with constellation and resource thread
pub struct SWManagerSenders {
@@ -177,6 +180,8 @@ pub enum ServiceWorkerMsg {
RegisterServiceWorker(ScopeThings, Url),
/// Timeout message sent by active service workers
Timeout(Url),
+ /// Backup message
+ ForwardDOMMessage(DOMMessage, Url),
/// Exit the service worker manager
Exit,
}
@@ -185,8 +190,6 @@ pub enum ServiceWorkerMsg {
#[derive(Deserialize, Serialize)]
pub enum SWManagerMsg {
/// Provide the constellation with a means of communicating with the Service Worker Manager
- OwnSender(IpcSender<ServiceWorkerMsg>),
- /// Message to ask to get a Trusted<ServiceWorker> to constellation
- ConnectServiceWorker(Url, PipelineId, IpcSender<DOMMessage>)
+ OwnSender(IpcSender<ServiceWorkerMsg>)
}