Explain unrooted_must_root on ServiceWorkerContainer::Register

This commit is contained in:
Manish Goregaokar 2019-01-03 16:29:22 -08:00
parent e28e73c81f
commit 6df1c6d7e7

View file

@ -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());
@ -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
}