diff options
author | Aron Zwaan <aronzwaan@gmail.com> | 2019-03-30 21:03:20 +0100 |
---|---|---|
committer | Aron Zwaan <aronzwaan@gmail.com> | 2019-04-03 20:45:30 +0200 |
commit | 782b58587acc754c7b378a84a4b51405738bb081 (patch) | |
tree | a530be8317cbda75e8d81679a7abc9fbd6379541 /components/script/dom/vrdisplay.rs | |
parent | 6fa1853bb1e9bc80271c5259a8d2ed7799a0d6ff (diff) | |
download | servo-782b58587acc754c7b378a84a4b51405738bb081.tar.gz servo-782b58587acc754c7b378a84a4b51405738bb081.zip |
Rename Promise::new to Promise::new_in_current_compartment
Diffstat (limited to 'components/script/dom/vrdisplay.rs')
-rw-r--r-- | components/script/dom/vrdisplay.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/components/script/dom/vrdisplay.rs b/components/script/dom/vrdisplay.rs index 3bcfbddd3b9..ec8af380ab9 100644 --- a/components/script/dom/vrdisplay.rs +++ b/components/script/dom/vrdisplay.rs @@ -341,8 +341,9 @@ impl VRDisplayMethods for VRDisplay { } // https://w3c.github.io/webvr/#dom-vrdisplay-requestpresent + #[allow(unsafe_code)] fn RequestPresent(&self, layers: Vec<VRLayer>) -> Rc<Promise> { - let promise = Promise::new(&self.global()); + let promise = unsafe {Promise::new_in_current_compartment(&self.global()) }; // TODO: WebVR spec: this method must be called in response to a user gesture // WebVR spec: If canPresent is false the promise MUST be rejected @@ -405,8 +406,9 @@ impl VRDisplayMethods for VRDisplay { } // https://w3c.github.io/webvr/#dom-vrdisplay-exitpresent + #[allow(unsafe_code)] fn ExitPresent(&self) -> Rc<Promise> { - let promise = Promise::new(&self.global()); + let promise = unsafe { Promise::new_in_current_compartment(&self.global()) }; // WebVR spec: If the VRDisplay is not presenting the promise MUST be rejected. if !self.presenting.get() { |