Make service workers talk to their serviceworkerglobalscopes

This commit is contained in:
Rahul Sharma 2016-07-28 23:34:44 +05:30
parent 72279cc7eb
commit 0996b38ade
13 changed files with 184 additions and 46 deletions

View file

@ -158,6 +158,10 @@ pub struct ScopeThings {
pub worker_id: WorkerId,
}
/// Message that gets passed to service worker scope on postMessage
#[derive(Deserialize, Serialize, Debug)]
pub struct DOMMessage(pub Vec<u64>);
/// Channels to allow service worker manager to communicate with constellation and resource thread
pub struct SWManagerSenders {
/// sender for communicating with constellation
@ -182,4 +186,7 @@ pub enum ServiceWorkerMsg {
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>)
}