serviceworker: turn-off event-loop, don't assume current scope, clear runtime on shutdown

This commit is contained in:
Gregory Terzian 2020-04-30 14:43:15 +08:00
parent 89eb7c2aa2
commit bd31860c5d
3 changed files with 49 additions and 46 deletions

View file

@ -212,7 +212,9 @@ impl ServiceWorkerManager {
fn handle_message_from_constellation(&mut self, msg: ServiceWorkerMsg) -> bool {
match msg {
ServiceWorkerMsg::Timeout(scope) => {},
ServiceWorkerMsg::Timeout(_scope) => {
// TODO: https://w3c.github.io/ServiceWorker/#terminate-service-worker
},
ServiceWorkerMsg::ForwardDOMMessage(msg, scope_url) => {
if let Some(registration) = self.registrations.get_mut(&scope_url) {
if let Some(ref worker) = registration.active_worker {