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()
|
||||
}
|
||||
|
||||
#[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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue