Skip to content

Commit

Permalink
Explain unrooted_must_root on ServiceWorkerContainer::Register
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Jan 4, 2019
1 parent e28e73c commit 6df1c6d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/script/dom/serviceworkercontainer.rs
Expand Up @@ -51,9 +51,9 @@ impl ServiceWorkerContainerMethods for ServiceWorkerContainer {
self.client.get_controller()
}

#[allow(unrooted_must_root)]
// https://w3c.github.io/ServiceWorker/#service-worker-container-register-method and - A
// https://w3c.github.io/ServiceWorker/#start-register-algorithm - B
/// https://w3c.github.io/ServiceWorker/#service-worker-container-register-method and - A
/// https://w3c.github.io/ServiceWorker/#start-register-algorithm - B
#[allow(unrooted_must_root)] // Job is unrooted
fn Register(&self, script_url: USVString, options: &RegistrationOptions) -> Rc<Promise> {
// A: Step 1
let promise = Promise::new(&*self.global());
Expand Down Expand Up @@ -124,6 +124,7 @@ impl ServiceWorkerContainerMethods for ServiceWorkerContainer {
promise.clone(),
&*self.client,
);
// Job is unrooted here, do not do anything other than immediately scheduling
ScriptThread::schedule_job(job);
promise
}
Expand Down

0 comments on commit 6df1c6d

Please sign in to comment.