Rename Promise::new to Promise::new_in_current_compartment

This commit is contained in:
Aron Zwaan 2019-03-30 21:03:20 +01:00
parent 6fa1853bb1
commit 782b58587a
25 changed files with 93 additions and 51 deletions

View file

@ -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() {