diff options
Diffstat (limited to 'components/script/dom/mediastreamaudiosourcenode.rs')
-rw-r--r-- | components/script/dom/mediastreamaudiosourcenode.rs | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/components/script/dom/mediastreamaudiosourcenode.rs b/components/script/dom/mediastreamaudiosourcenode.rs index f6925af75c3..4137b0c2896 100644 --- a/components/script/dom/mediastreamaudiosourcenode.rs +++ b/components/script/dom/mediastreamaudiosourcenode.rs @@ -9,11 +9,12 @@ use crate::dom::bindings::codegen::Bindings::MediaStreamAudioSourceNodeBinding:: }; use crate::dom::bindings::error::{Error, Fallible}; use crate::dom::bindings::inheritance::Castable; -use crate::dom::bindings::reflector::reflect_dom_object; +use crate::dom::bindings::reflector::reflect_dom_object2; use crate::dom::bindings::root::{Dom, DomRoot}; use crate::dom::mediastream::MediaStream; use crate::dom::window::Window; use dom_struct::dom_struct; +use js::rust::HandleObject; use servo_media::audio::node::AudioNodeInit; use servo_media::streams::MediaStreamType; @@ -48,23 +49,33 @@ impl MediaStreamAudioSourceNode { }) } - #[allow(unrooted_must_root)] pub fn new( window: &Window, context: &AudioContext, stream: &MediaStream, ) -> Fallible<DomRoot<MediaStreamAudioSourceNode>> { + Self::new_with_proto(window, None, context, stream) + } + + #[allow(unrooted_must_root)] + fn new_with_proto( + window: &Window, + proto: Option<HandleObject>, + context: &AudioContext, + stream: &MediaStream, + ) -> Fallible<DomRoot<MediaStreamAudioSourceNode>> { let node = MediaStreamAudioSourceNode::new_inherited(context, stream)?; - Ok(reflect_dom_object(Box::new(node), window)) + Ok(reflect_dom_object2(Box::new(node), window, proto)) } #[allow(non_snake_case)] pub fn Constructor( window: &Window, + proto: Option<HandleObject>, context: &AudioContext, options: &MediaStreamAudioSourceOptions, ) -> Fallible<DomRoot<MediaStreamAudioSourceNode>> { - MediaStreamAudioSourceNode::new(window, context, &options.mediaStream) + MediaStreamAudioSourceNode::new_with_proto(window, proto, context, &options.mediaStream) } } |