diff options
Diffstat (limited to 'components/script/dom/gainnode.rs')
-rw-r--r-- | components/script/dom/gainnode.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/components/script/dom/gainnode.rs b/components/script/dom/gainnode.rs index 17c32b00352..a48cdc7c86b 100644 --- a/components/script/dom/gainnode.rs +++ b/components/script/dom/gainnode.rs @@ -31,7 +31,7 @@ impl GainNode { window: &Window, context: &BaseAudioContext, options: &GainOptions, - ) -> GainNode { + ) -> Fallible<GainNode> { let mut node_options = AudioNodeOptions::empty(); let count = options.parent.channelCount.unwrap_or(2); let mode = options.parent.channelCountMode.unwrap_or(ChannelCountMode::Max); @@ -45,7 +45,7 @@ impl GainNode { &node_options, 1, // inputs 1, // outputs - ); + )?; let gain = AudioParam::new( window, context, @@ -56,10 +56,10 @@ impl GainNode { f32::MIN, // min value f32::MAX, // max value ); - GainNode { + Ok(GainNode { node, gain: Dom::from_ref(&gain), - } + }) } #[allow(unrooted_must_root)] @@ -67,9 +67,9 @@ impl GainNode { window: &Window, context: &BaseAudioContext, options: &GainOptions, - ) -> DomRoot<GainNode> { - let node = GainNode::new_inherited(window, context, options); - reflect_dom_object(Box::new(node), window, GainNodeBinding::Wrap) + ) -> Fallible<DomRoot<GainNode>> { + let node = GainNode::new_inherited(window, context, options)?; + Ok(reflect_dom_object(Box::new(node), window, GainNodeBinding::Wrap)) } pub fn Constructor( @@ -77,7 +77,7 @@ impl GainNode { context: &BaseAudioContext, options: &GainOptions, ) -> Fallible<DomRoot<GainNode>> { - Ok(GainNode::new(window, context, options)) + GainNode::new(window, context, options) } } |