aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/oscillatornode.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/oscillatornode.rs')
-rw-r--r--components/script/dom/oscillatornode.rs19
1 files changed, 15 insertions, 4 deletions
diff --git a/components/script/dom/oscillatornode.rs b/components/script/dom/oscillatornode.rs
index 948603ca6e2..febc8f95d01 100644
--- a/components/script/dom/oscillatornode.rs
+++ b/components/script/dom/oscillatornode.rs
@@ -14,10 +14,11 @@ use crate::dom::bindings::codegen::Bindings::OscillatorNodeBinding::{
OscillatorOptions, OscillatorType,
};
use crate::dom::bindings::error::{Error, ErrorResult, Fallible};
-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::window::Window;
use dom_struct::dom_struct;
+use js::rust::HandleObject;
use servo_media::audio::node::{AudioNodeInit, AudioNodeMessage};
use servo_media::audio::oscillator_node::OscillatorNodeMessage;
use servo_media::audio::oscillator_node::OscillatorNodeOptions as ServoMediaOscillatorOptions;
@@ -81,23 +82,33 @@ impl OscillatorNode {
})
}
- #[allow(unrooted_must_root)]
pub fn new(
window: &Window,
context: &BaseAudioContext,
options: &OscillatorOptions,
) -> Fallible<DomRoot<OscillatorNode>> {
+ Self::new_with_proto(window, None, context, options)
+ }
+
+ #[allow(unrooted_must_root)]
+ fn new_with_proto(
+ window: &Window,
+ proto: Option<HandleObject>,
+ context: &BaseAudioContext,
+ options: &OscillatorOptions,
+ ) -> Fallible<DomRoot<OscillatorNode>> {
let node = OscillatorNode::new_inherited(window, context, options)?;
- 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: &BaseAudioContext,
options: &OscillatorOptions,
) -> Fallible<DomRoot<OscillatorNode>> {
- OscillatorNode::new(window, context, options)
+ OscillatorNode::new_with_proto(window, proto, context, options)
}
}