mirror of
https://github.com/servo/servo.git
synced 2025-08-01 19:50:30 +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>
|
/// <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();
|
let global = self.global();
|
||||||
self.destination.or_init(|| {
|
self.destination.or_init(|| {
|
||||||
let mut options = AudioNodeOptions::empty();
|
let mut options = AudioNodeOptions::empty();
|
||||||
options.channelCount = Some(self.channel_count);
|
options.channelCount = Some(self.channel_count);
|
||||||
options.channelCountMode = Some(ChannelCountMode::Explicit);
|
options.channelCountMode = Some(ChannelCountMode::Explicit);
|
||||||
options.channelInterpretation = Some(ChannelInterpretation::Speakers);
|
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>
|
/// <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 global = self.global();
|
||||||
let window = global.as_window();
|
let window = global.as_window();
|
||||||
self.listener
|
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
|
// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-onstatechange
|
||||||
|
|
|
@ -29,7 +29,7 @@ DOMInterfaces = {
|
||||||
|
|
||||||
'BaseAudioContext': {
|
'BaseAudioContext': {
|
||||||
'inRealms': ['DecodeAudioData', 'Resume', 'ParseFromString', 'GetBounds', 'GetClientRects'],
|
'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': {
|
'Blob': {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue