aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/xr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/xr.rs')
-rw-r--r--components/script/dom/xr.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/components/script/dom/xr.rs b/components/script/dom/xr.rs
index 13838ac2b20..95fc5003c2a 100644
--- a/components/script/dom/xr.rs
+++ b/components/script/dom/xr.rs
@@ -83,9 +83,10 @@ impl Drop for XR {
impl XRMethods for XR {
/// https://immersive-web.github.io/webxr/#dom-xr-supportssessionmode
+ #[allow(unsafe_code)]
fn SupportsSessionMode(&self, mode: XRSessionMode) -> Rc<Promise> {
// XXXManishearth this should select an XR device first
- let promise = Promise::new(&self.global());
+ let promise = unsafe { Promise::new_in_current_compartment(&self.global()) };
if mode == XRSessionMode::Immersive_vr {
promise.resolve_native(&());
} else {
@@ -97,8 +98,9 @@ impl XRMethods for XR {
}
/// https://immersive-web.github.io/webxr/#dom-xr-requestsession
+ #[allow(unsafe_code)]
fn RequestSession(&self, options: &XRSessionCreationOptions) -> Rc<Promise> {
- let promise = Promise::new(&self.global());
+ let promise = unsafe { Promise::new_in_current_compartment(&self.global()) };
if options.mode != XRSessionMode::Immersive_vr {
promise.reject_error(Error::NotSupported);
return promise;