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

@ -273,9 +273,10 @@ impl BaseAudioContextMethods for BaseAudioContext {
}
/// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-resume
#[allow(unsafe_code)]
fn Resume(&self) -> Rc<Promise> {
// Step 1.
let promise = Promise::new(&self.global());
let promise = unsafe { Promise::new_in_current_compartment(&self.global()) };
// Step 2.
if self.audio_context_impl.state() == ProcessingState::Closed {
@ -405,6 +406,7 @@ impl BaseAudioContextMethods for BaseAudioContext {
}
// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-decodeaudiodata
#[allow(unsafe_code)]
fn DecodeAudioData(
&self,
audio_data: CustomAutoRooterGuard<ArrayBuffer>,
@ -412,7 +414,7 @@ impl BaseAudioContextMethods for BaseAudioContext {
decode_error_callback: Option<Rc<DecodeErrorCallback>>,
) -> Rc<Promise> {
// Step 1.
let promise = Promise::new(&self.global());
let promise = unsafe { Promise::new_in_current_compartment(&self.global()) };
let global = self.global();
let window = global.as_window();