Reformat WorkletGlobalScope::new_inherited

This commit is contained in:
Anthony Ramine 2017-09-13 09:57:27 +02:00
parent 0822a74f94
commit 71df1d5d9b

View file

@ -57,19 +57,21 @@ pub struct WorkletGlobalScope {
impl WorkletGlobalScope { impl WorkletGlobalScope {
/// Create a new stack-allocated `WorkletGlobalScope`. /// Create a new stack-allocated `WorkletGlobalScope`.
pub fn new_inherited(pipeline_id: PipelineId, pub fn new_inherited(
pipeline_id: PipelineId,
base_url: ServoUrl, base_url: ServoUrl,
executor: WorkletExecutor, executor: WorkletExecutor,
init: &WorkletGlobalScopeInit) init: &WorkletGlobalScopeInit,
-> WorkletGlobalScope { ) -> Self {
// Any timer events fired on this global are ignored. // Any timer events fired on this global are ignored.
let (timer_event_chan, _) = ipc::channel().unwrap(); let (timer_event_chan, _) = ipc::channel().unwrap();
let script_to_constellation_chan = ScriptToConstellationChan { let script_to_constellation_chan = ScriptToConstellationChan {
sender: init.to_constellation_sender.clone(), sender: init.to_constellation_sender.clone(),
pipeline_id: pipeline_id, pipeline_id,
}; };
WorkletGlobalScope { Self {
globalscope: GlobalScope::new_inherited(pipeline_id, globalscope: GlobalScope::new_inherited(
pipeline_id,
init.devtools_chan.clone(), init.devtools_chan.clone(),
init.mem_profiler_chan.clone(), init.mem_profiler_chan.clone(),
init.time_profiler_chan.clone(), init.time_profiler_chan.clone(),
@ -77,11 +79,12 @@ impl WorkletGlobalScope {
init.scheduler_chan.clone(), init.scheduler_chan.clone(),
init.resource_threads.clone(), init.resource_threads.clone(),
timer_event_chan, timer_event_chan,
MutableOrigin::new(ImmutableOrigin::new_opaque())), MutableOrigin::new(ImmutableOrigin::new_opaque()),
base_url: base_url, ),
microtask_queue: MicrotaskQueue::default(), base_url,
microtask_queue: Default::default(),
to_script_thread_sender: init.to_script_thread_sender.clone(), to_script_thread_sender: init.to_script_thread_sender.clone(),
executor: executor, executor,
} }
} }