CanGc fixes starting from blob.rs, mediastream.rs, custom_event.rs (#33820)

Signed-off-by: L Ashwin B <lashwinib@gmail.com>
This commit is contained in:
chickenleaf 2024-10-12 22:47:47 +05:30 committed by GitHub
parent bd8006afc5
commit a55f9a37ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 58 additions and 28 deletions

View file

@ -33,10 +33,11 @@ impl MediaStreamAudioDestinationNode {
pub fn new_inherited(
context: &AudioContext,
options: &AudioNodeOptions,
can_gc: CanGc,
) -> Fallible<MediaStreamAudioDestinationNode> {
let media = ServoMedia::get().unwrap();
let (socket, id) = media.create_stream_and_socket(MediaStreamType::Audio);
let stream = MediaStream::new_single(&context.global(), id, MediaStreamType::Audio);
let stream = MediaStream::new_single(&context.global(), id, MediaStreamType::Audio, can_gc);
let node_options = options.unwrap_or(
2,
ChannelCountMode::Explicit,
@ -59,8 +60,9 @@ impl MediaStreamAudioDestinationNode {
window: &Window,
context: &AudioContext,
options: &AudioNodeOptions,
can_gc: CanGc,
) -> Fallible<DomRoot<MediaStreamAudioDestinationNode>> {
Self::new_with_proto(window, None, context, options, CanGc::note())
Self::new_with_proto(window, None, context, options, can_gc)
}
#[allow(crown::unrooted_must_root)]
@ -71,7 +73,7 @@ impl MediaStreamAudioDestinationNode {
options: &AudioNodeOptions,
can_gc: CanGc,
) -> Fallible<DomRoot<MediaStreamAudioDestinationNode>> {
let node = MediaStreamAudioDestinationNode::new_inherited(context, options)?;
let node = MediaStreamAudioDestinationNode::new_inherited(context, options, can_gc)?;
Ok(reflect_dom_object_with_proto(
Box::new(node),
window,