aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_traits/script_msg.rs
diff options
context:
space:
mode:
authorRahul Sharma <rsconceptx@gmail.com>2016-08-24 23:22:02 +0530
committerRahul Sharma <rsconceptx@gmail.com>2016-09-07 12:07:36 +0530
commit9dcb7348a2c69be69ae8284d56715177713091d2 (patch)
tree7890823d9280440d7db7b762905a9b060a0a7f93 /components/script_traits/script_msg.rs
parent0996b38ade7e2fe368ad7bd21ba8cf9a48d8f866 (diff)
downloadservo-9dcb7348a2c69be69ae8284d56715177713091d2.tar.gz
servo-9dcb7348a2c69be69ae8284d56715177713091d2.zip
store senders instead of buffering messages
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>)
}