mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Rename Promise::new to Promise::new_in_current_compartment
This commit is contained in:
parent
6fa1853bb1
commit
782b58587a
25 changed files with 93 additions and 51 deletions
|
@ -107,9 +107,10 @@ impl AudioContextMethods for AudioContext {
|
|||
}
|
||||
|
||||
// https://webaudio.github.io/web-audio-api/#dom-audiocontext-suspend
|
||||
#[allow(unsafe_code)]
|
||||
fn Suspend(&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.context.control_thread_state() == ProcessingState::Closed {
|
||||
|
@ -168,9 +169,10 @@ impl AudioContextMethods for AudioContext {
|
|||
}
|
||||
|
||||
// https://webaudio.github.io/web-audio-api/#dom-audiocontext-close
|
||||
#[allow(unsafe_code)]
|
||||
fn Close(&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.context.control_thread_state() == ProcessingState::Closed {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue