aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/serviceworkercontainer.rs
diff options
context:
space:
mode:
authorBastien Orivel <eijebong@bananium.fr>2019-05-25 17:00:10 +0200
committerBastien Orivel <eijebong@bananium.fr>2019-05-25 17:28:07 +0200
commit292d468cd1552dd5644e8e0e2bf617b8bcac7655 (patch)
tree0d4069144e989bfab6ebeea66654654ccbb851c5 /components/script/dom/serviceworkercontainer.rs
parent0b29caa5548b0e307f2a891f5082b940c10d5762 (diff)
downloadservo-292d468cd1552dd5644e8e0e2bf617b8bcac7655.tar.gz
servo-292d468cd1552dd5644e8e0e2bf617b8bcac7655.zip
Use the newly added inCompartments option everywhere it can be
Diffstat (limited to 'components/script/dom/serviceworkercontainer.rs')
-rw-r--r--components/script/dom/serviceworkercontainer.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/components/script/dom/serviceworkercontainer.rs b/components/script/dom/serviceworkercontainer.rs
index 094278198d4..ed1b79a5c8a 100644
--- a/components/script/dom/serviceworkercontainer.rs
+++ b/components/script/dom/serviceworkercontainer.rs
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-use crate::compartments::{AlreadyInCompartment, InCompartment};
+use crate::compartments::InCompartment;
use crate::dom::bindings::codegen::Bindings::ServiceWorkerContainerBinding::RegistrationOptions;
use crate::dom::bindings::codegen::Bindings::ServiceWorkerContainerBinding::{
ServiceWorkerContainerMethods, Wrap,
@@ -55,13 +55,14 @@ impl ServiceWorkerContainerMethods for ServiceWorkerContainer {
#[allow(unrooted_must_root)] // Job is unrooted
/// https://w3c.github.io/ServiceWorker/#navigator-service-worker-register and - A
/// https://w3c.github.io/ServiceWorker/#start-register-algorithm - B
- fn Register(&self, script_url: USVString, options: &RegistrationOptions) -> Rc<Promise> {
+ fn Register(
+ &self,
+ script_url: USVString,
+ options: &RegistrationOptions,
+ comp: InCompartment,
+ ) -> Rc<Promise> {
// A: Step 1
- let in_compartment_proof = AlreadyInCompartment::assert(&*self.global());
- let promise = Promise::new_in_current_compartment(
- &*self.global(),
- InCompartment::Already(&in_compartment_proof),
- );
+ let promise = Promise::new_in_current_compartment(&*self.global(), comp);
let USVString(ref script_url) = script_url;
let api_base_url = self.global().api_base_url();
// A: Step 3-5