mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Make service workers talk to their serviceworkerglobalscopes
This commit is contained in:
parent
72279cc7eb
commit
0996b38ade
13 changed files with 184 additions and 46 deletions
|
@ -392,10 +392,12 @@ impl WorkerGlobalScope {
|
|||
}
|
||||
|
||||
pub fn script_chan(&self) -> Box<ScriptChan + Send> {
|
||||
let dedicated =
|
||||
self.downcast::<DedicatedWorkerGlobalScope>();
|
||||
let dedicated = self.downcast::<DedicatedWorkerGlobalScope>();
|
||||
let service_worker = self.downcast::<ServiceWorkerGlobalScope>();
|
||||
if let Some(dedicated) = dedicated {
|
||||
return dedicated.script_chan();
|
||||
} else if let Some(service_worker) = service_worker {
|
||||
return service_worker.script_chan();
|
||||
} else {
|
||||
panic!("need to implement a sender for SharedWorker/ServiceWorker")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue