mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Mark promise creation methods with CanGc (#33928)
* Add CanGc annotations to promise constructor. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Propagate CanGc arguments for Promise::new_in_current_realm. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix out-of-order entries. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Propagate CanGc from Promise::new. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Suppress clippy warning. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
edc304854f
commit
575e885529
50 changed files with 422 additions and 221 deletions
|
@ -294,9 +294,9 @@ impl BaseAudioContextMethods for BaseAudioContext {
|
|||
}
|
||||
|
||||
/// <https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-resume>
|
||||
fn Resume(&self, comp: InRealm) -> Rc<Promise> {
|
||||
fn Resume(&self, comp: InRealm, can_gc: CanGc) -> Rc<Promise> {
|
||||
// Step 1.
|
||||
let promise = Promise::new_in_current_realm(comp);
|
||||
let promise = Promise::new_in_current_realm(comp, can_gc);
|
||||
|
||||
// Step 2.
|
||||
if self.audio_context_impl.lock().unwrap().state() == ProcessingState::Closed {
|
||||
|
@ -480,9 +480,10 @@ impl BaseAudioContextMethods for BaseAudioContext {
|
|||
decode_success_callback: Option<Rc<DecodeSuccessCallback>>,
|
||||
decode_error_callback: Option<Rc<DecodeErrorCallback>>,
|
||||
comp: InRealm,
|
||||
can_gc: CanGc,
|
||||
) -> Rc<Promise> {
|
||||
// Step 1.
|
||||
let promise = Promise::new_in_current_realm(comp);
|
||||
let promise = Promise::new_in_current_realm(comp, can_gc);
|
||||
let global = self.global();
|
||||
let window = global.as_window();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue