diff options
Diffstat (limited to 'components/script/dom/xr.rs')
-rw-r--r-- | components/script/dom/xr.rs | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/components/script/dom/xr.rs b/components/script/dom/xr.rs index 3ff67b0042c..61f65a97901 100644 --- a/components/script/dom/xr.rs +++ b/components/script/dom/xr.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::cell::DomRefCell; use crate::dom::bindings::codegen::Bindings::VRDisplayBinding::VRDisplayMethods; use crate::dom::bindings::codegen::Bindings::XRBinding; @@ -84,13 +84,9 @@ impl Drop for XR { impl XRMethods for XR { /// https://immersive-web.github.io/webxr/#dom-xr-supportssessionmode - fn SupportsSessionMode(&self, mode: XRSessionMode) -> Rc<Promise> { + fn SupportsSessionMode(&self, mode: XRSessionMode, comp: InCompartment) -> Rc<Promise> { // XXXManishearth this should select an XR device first - 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); if mode == XRSessionMode::Immersive_vr { promise.resolve_native(&()); } else { @@ -102,12 +98,12 @@ impl XRMethods for XR { } /// https://immersive-web.github.io/webxr/#dom-xr-requestsession - fn RequestSession(&self, options: &XRSessionCreationOptions) -> Rc<Promise> { - let in_compartment_proof = AlreadyInCompartment::assert(&self.global()); - let promise = Promise::new_in_current_compartment( - &self.global(), - InCompartment::Already(&in_compartment_proof), - ); + fn RequestSession( + &self, + options: &XRSessionCreationOptions, + comp: InCompartment, + ) -> Rc<Promise> { + let promise = Promise::new_in_current_compartment(&self.global(), comp); if options.mode != XRSessionMode::Immersive_vr { promise.reject_error(Error::NotSupported); return promise; |