aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/serviceworkercontainer.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-06-02 14:41:20 -0400
committerGitHub <noreply@github.com>2019-06-02 14:41:20 -0400
commit03f223663f1c0bc7432f0f47b533fb41c0226eb1 (patch)
treec17adc3c51a757f7d84f5f0ae4e930d8e087acbc /components/script/dom/serviceworkercontainer.rs
parent31ee17e9e1c6012fd512f594c27abb44fe927ec4 (diff)
parentb7e10a82247545c2f9894e9fb61540caf0b7f157 (diff)
downloadservo-03f223663f1c0bc7432f0f47b533fb41c0226eb1.tar.gz
servo-03f223663f1c0bc7432f0f47b533fb41c0226eb1.zip
Auto merge of #23459 - Eijebong:compartments, r=jdm
Add an inCompartments config option for bindings Fixes #23257 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23459) <!-- Reviewable:end -->
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