Format script component

This commit is contained in:
chansuke 2018-09-18 23:24:15 +09:00 committed by Josh Matthews
parent 2ca7a13473
commit c37a345dc9
357 changed files with 25485 additions and 18076 deletions

View file

@ -41,17 +41,14 @@ pub struct OfflineAudioContext {
impl OfflineAudioContext {
#[allow(unrooted_must_root)]
fn new_inherited(channel_count: u32,
length: u32,
sample_rate: f32) -> OfflineAudioContext {
fn new_inherited(channel_count: u32, length: u32, sample_rate: f32) -> OfflineAudioContext {
let options = ServoMediaOfflineAudioContextOptions {
channels: channel_count as u8,
length: length as usize,
sample_rate,
};
let context = BaseAudioContext::new_inherited(
BaseAudioContextOptions::OfflineAudioContext(options),
);
let context =
BaseAudioContext::new_inherited(BaseAudioContextOptions::OfflineAudioContext(options));
OfflineAudioContext {
context,
channel_count,
@ -62,10 +59,12 @@ impl OfflineAudioContext {
}
#[allow(unrooted_must_root)]
fn new(window: &Window,
channel_count: u32,
length: u32,
sample_rate: f32) -> DomRoot<OfflineAudioContext> {
fn new(
window: &Window,
channel_count: u32,
length: u32,
sample_rate: f32,
) -> DomRoot<OfflineAudioContext> {
let context = OfflineAudioContext::new_inherited(channel_count, length, sample_rate);
reflect_dom_object(Box::new(context), window, OfflineAudioContextBinding::Wrap)
}
@ -74,7 +73,12 @@ impl OfflineAudioContext {
window: &Window,
options: &OfflineAudioContextOptions,
) -> Fallible<DomRoot<OfflineAudioContext>> {
Ok(OfflineAudioContext::new(window, options.numberOfChannels, options.length, *options.sampleRate))
Ok(OfflineAudioContext::new(
window,
options.numberOfChannels,
options.length,
*options.sampleRate,
))
}
pub fn Constructor_(
@ -92,7 +96,12 @@ impl OfflineAudioContext {
return Err(Error::NotSupported);
}
Ok(OfflineAudioContext::new(window, number_of_channels, length, *sample_rate))
Ok(OfflineAudioContext::new(
window,
number_of_channels,
length,
*sample_rate,
))
}
}