mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Explain unrooted_must_root on ServiceWorkerContainer::Register
This commit is contained in:
parent
e28e73c81f
commit
6df1c6d7e7
1 changed files with 4 additions and 3 deletions
|
@ -51,9 +51,9 @@ impl ServiceWorkerContainerMethods for ServiceWorkerContainer {
|
||||||
self.client.get_controller()
|
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/#service-worker-container-register-method and - A
|
/// https://w3c.github.io/ServiceWorker/#start-register-algorithm - B
|
||||||
// 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> {
|
fn Register(&self, script_url: USVString, options: &RegistrationOptions) -> Rc<Promise> {
|
||||||
// A: Step 1
|
// A: Step 1
|
||||||
let promise = Promise::new(&*self.global());
|
let promise = Promise::new(&*self.global());
|
||||||
|
@ -124,6 +124,7 @@ impl ServiceWorkerContainerMethods for ServiceWorkerContainer {
|
||||||
promise.clone(),
|
promise.clone(),
|
||||||
&*self.client,
|
&*self.client,
|
||||||
);
|
);
|
||||||
|
// Job is unrooted here, do not do anything other than immediately scheduling
|
||||||
ScriptThread::schedule_job(job);
|
ScriptThread::schedule_job(job);
|
||||||
promise
|
promise
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue