mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
refactor: add CanGc as argument to BaseAudioContext::{Destination, Listener} (#35729)
Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
This commit is contained in:
parent
6112ebdf5d
commit
e91d44d023
2 changed files with 5 additions and 5 deletions
|
@ -317,23 +317,23 @@ impl BaseAudioContextMethods<crate::DomTypeHolder> for BaseAudioContext {
|
|||
}
|
||||
|
||||
/// <https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-destination>
|
||||
fn Destination(&self) -> DomRoot<AudioDestinationNode> {
|
||||
fn Destination(&self, can_gc: CanGc) -> DomRoot<AudioDestinationNode> {
|
||||
let global = self.global();
|
||||
self.destination.or_init(|| {
|
||||
let mut options = AudioNodeOptions::empty();
|
||||
options.channelCount = Some(self.channel_count);
|
||||
options.channelCountMode = Some(ChannelCountMode::Explicit);
|
||||
options.channelInterpretation = Some(ChannelInterpretation::Speakers);
|
||||
AudioDestinationNode::new(&global, self, &options, CanGc::note())
|
||||
AudioDestinationNode::new(&global, self, &options, can_gc)
|
||||
})
|
||||
}
|
||||
|
||||
/// <https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-listener>
|
||||
fn Listener(&self) -> DomRoot<AudioListener> {
|
||||
fn Listener(&self, can_gc: CanGc) -> DomRoot<AudioListener> {
|
||||
let global = self.global();
|
||||
let window = global.as_window();
|
||||
self.listener
|
||||
.or_init(|| AudioListener::new(window, self, CanGc::note()))
|
||||
.or_init(|| AudioListener::new(window, self, can_gc))
|
||||
}
|
||||
|
||||
// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-onstatechange
|
||||
|
|
|
@ -29,7 +29,7 @@ DOMInterfaces = {
|
|||
|
||||
'BaseAudioContext': {
|
||||
'inRealms': ['DecodeAudioData', 'Resume', 'ParseFromString', 'GetBounds', 'GetClientRects'],
|
||||
'canGc': ['CreateChannelMerger', 'CreateOscillator', 'CreateStereoPanner', 'CreateGain', 'CreateIIRFilter', 'CreateBiquadFilter', 'CreateBufferSource', 'CreateAnalyser', 'CreatePanner', 'CreateChannelSplitter', 'CreateBuffer', 'CreateConstantSource', 'Resume', 'DecodeAudioData'],
|
||||
'canGc': ['CreateChannelMerger', 'CreateOscillator', 'CreateStereoPanner', 'CreateGain', 'CreateIIRFilter', 'CreateBiquadFilter', 'CreateBufferSource', 'CreateAnalyser', 'CreatePanner', 'CreateChannelSplitter', 'CreateBuffer', 'CreateConstantSource', 'Resume', 'DecodeAudioData', 'Destination', 'Listener'],
|
||||
},
|
||||
|
||||
'Blob': {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue