diff options
author | Taym Haddadi <haddadi.taym@gmail.com> | 2024-02-25 13:13:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-25 12:13:17 +0000 |
commit | d0b663800f3faa7343791349c9b0e38e9aeacb82 (patch) | |
tree | b6c65c6bcd3a5b9a1f1da7e7367c2c498e972417 /components/script/dom/audiobuffer.rs | |
parent | 32f1d07323db257db31fead024271d3a57d72b49 (diff) | |
download | servo-d0b663800f3faa7343791349c9b0e38e9aeacb82.tar.gz servo-d0b663800f3faa7343791349c9b0e38e9aeacb82.zip |
WedIDL: bring dom/bindings/typedarray further in line with spec (#31375)
* WedIDL: bring dom/bindings/typedarray further in line with spec
Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
* Rename HeapBufferSourceTypes to HeapBufferSource
Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
* fmt code
Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
---------
Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
Diffstat (limited to 'components/script/dom/audiobuffer.rs')
-rw-r--r-- | components/script/dom/audiobuffer.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/components/script/dom/audiobuffer.rs b/components/script/dom/audiobuffer.rs index 9bb797cba09..7f2545f3934 100644 --- a/components/script/dom/audiobuffer.rs +++ b/components/script/dom/audiobuffer.rs @@ -9,7 +9,7 @@ use js::rust::{CustomAutoRooterGuard, HandleObject}; use js::typedarray::{Float32, Float32Array}; use servo_media::audio::buffer_source_node::AudioBuffer as ServoMediaAudioBuffer; -use super::bindings::typedarrays::HeapTypedArray; +use super::bindings::buffer_source::HeapBufferSource; use crate::dom::audionode::MAX_CHANNEL_COUNT; use crate::dom::bindings::cell::{DomRefCell, Ref}; use crate::dom::bindings::codegen::Bindings::AudioBufferBinding::{ @@ -42,7 +42,7 @@ pub struct AudioBuffer { reflector_: Reflector, /// Float32Arrays returned by calls to GetChannelData. #[ignore_malloc_size_of = "mozjs"] - js_channels: DomRefCell<Vec<HeapTypedArray<Float32>>>, + js_channels: DomRefCell<Vec<HeapBufferSource<Float32>>>, /// Aggregates the data from js_channels. /// This is Some<T> iff the buffers in js_channels are detached. #[ignore_malloc_size_of = "servo_media"] @@ -60,10 +60,9 @@ pub struct AudioBuffer { impl AudioBuffer { #[allow(crown::unrooted_must_root)] - #[allow(unsafe_code)] pub fn new_inherited(number_of_channels: u32, length: u32, sample_rate: f32) -> AudioBuffer { let vec = (0..number_of_channels) - .map(|_| HeapTypedArray::default()) + .map(|_| HeapBufferSource::default()) .collect(); AudioBuffer { reflector_: Reflector::new(), @@ -238,7 +237,7 @@ impl AudioBufferMethods for AudioBuffer { } self.js_channels.borrow()[channel as usize] - .get_internal() + .get_buffer() .map_err(|_| Error::JSFailed) } |