aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/script/dom/audionode.rs8
-rw-r--r--components/script/dom/baseaudiocontext.rs5
-rw-r--r--components/script/dom/bindings/trace.rs2
3 files changed, 10 insertions, 5 deletions
diff --git a/components/script/dom/audionode.rs b/components/script/dom/audionode.rs
index 56e3bdd25ba..2ef9b0635e6 100644
--- a/components/script/dom/audionode.rs
+++ b/components/script/dom/audionode.rs
@@ -10,10 +10,11 @@ use dom::bindings::reflector::Reflector;
use dom::bindings::root::DomRoot;
use dom::audioparam::AudioParam;
use dom_struct::dom_struct;
+use servo_media::audio::graph_impl::NodeId;
use servo_media::audio::node::AudioNodeType;
use std::cell::Cell;
-// 32 is the minimum required by the spec for createBuffer() and
+// 32 is the minimum required by the spec for createBuffer() and the deprecated
// createScriptProcessor() and matches what is used by Blink and Gecko.
// The limit protects against large memory allocations.
pub static MAX_CHANNEL_COUNT: u32 = 32;
@@ -21,7 +22,8 @@ pub static MAX_CHANNEL_COUNT: u32 = 32;
#[dom_struct]
pub struct AudioNode {
reflector_: Reflector,
- engine_id: usize,
+ #[ignore_malloc_size_of = "servo_media"]
+ node_id: NodeId,
context: DomRoot<BaseAudioContext>,
number_of_inputs: u32,
number_of_outputs: u32,
@@ -38,7 +40,7 @@ impl AudioNode {
number_of_outputs: u32) -> AudioNode {
AudioNode {
reflector_: Reflector::new(),
- engine_id: context.create_node_engine(node_type),
+ node_id: context.create_node_engine(node_type),
context: DomRoot::from_ref(context),
number_of_inputs,
number_of_outputs,
diff --git a/components/script/dom/baseaudiocontext.rs b/components/script/dom/baseaudiocontext.rs
index 0820b7eec67..f8fa01bd0f4 100644
--- a/components/script/dom/baseaudiocontext.rs
+++ b/components/script/dom/baseaudiocontext.rs
@@ -17,13 +17,14 @@ use dom::oscillatornode::OscillatorNode;
use dom_struct::dom_struct;
use servo_media::ServoMedia;
use servo_media::audio::graph::AudioGraph;
+use servo_media::audio::graph_impl::NodeId;
use servo_media::audio::node::AudioNodeType;
use std::rc::Rc;
#[dom_struct]
pub struct BaseAudioContext {
reflector_: Reflector,
- #[ignore_malloc_size_of = "XXX"]
+ #[ignore_malloc_size_of = "servo_media"]
audio_graph: AudioGraph,
destination: Option<DomRoot<AudioDestinationNode>>,
sample_rate: f32,
@@ -58,7 +59,7 @@ impl BaseAudioContext {
context
}
- pub fn create_node_engine(&self, node_type: AudioNodeType) -> usize {
+ pub fn create_node_engine(&self, node_type: AudioNodeType) -> NodeId {
self.audio_graph.create_node(node_type)
}
}
diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs
index 1f39f33f209..4724f2a8c3a 100644
--- a/components/script/dom/bindings/trace.rs
+++ b/components/script/dom/bindings/trace.rs
@@ -81,6 +81,7 @@ use parking_lot::RwLock;
use profile_traits::mem::ProfilerChan as MemProfilerChan;
use profile_traits::time::ProfilerChan as TimeProfilerChan;
use servo_media::audio::graph::AudioGraph;
+use servo_media::audio::graph_impl::NodeId;
use script_layout_interface::OpaqueStyleAndLayoutData;
use script_layout_interface::reporter::CSSErrorReporter;
use script_layout_interface::rpc::LayoutRPC;
@@ -431,6 +432,7 @@ unsafe_no_jsmanaged_fields!(InteractiveWindow);
unsafe_no_jsmanaged_fields!(CanvasId);
unsafe_no_jsmanaged_fields!(SourceSet);
unsafe_no_jsmanaged_fields!(AudioGraph);
+unsafe_no_jsmanaged_fields!(NodeId);
unsafe impl<'a> JSTraceable for &'a str {
#[inline]