mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Reformat WorkletGlobalScope::new_inherited
This commit is contained in:
parent
0822a74f94
commit
71df1d5d9b
1 changed files with 22 additions and 19 deletions
|
@ -57,31 +57,34 @@ pub struct WorkletGlobalScope {
|
|||
|
||||
impl WorkletGlobalScope {
|
||||
/// Create a new stack-allocated `WorkletGlobalScope`.
|
||||
pub fn new_inherited(pipeline_id: PipelineId,
|
||||
base_url: ServoUrl,
|
||||
executor: WorkletExecutor,
|
||||
init: &WorkletGlobalScopeInit)
|
||||
-> WorkletGlobalScope {
|
||||
pub fn new_inherited(
|
||||
pipeline_id: PipelineId,
|
||||
base_url: ServoUrl,
|
||||
executor: WorkletExecutor,
|
||||
init: &WorkletGlobalScopeInit,
|
||||
) -> Self {
|
||||
// Any timer events fired on this global are ignored.
|
||||
let (timer_event_chan, _) = ipc::channel().unwrap();
|
||||
let script_to_constellation_chan = ScriptToConstellationChan {
|
||||
sender: init.to_constellation_sender.clone(),
|
||||
pipeline_id: pipeline_id,
|
||||
pipeline_id,
|
||||
};
|
||||
WorkletGlobalScope {
|
||||
globalscope: GlobalScope::new_inherited(pipeline_id,
|
||||
init.devtools_chan.clone(),
|
||||
init.mem_profiler_chan.clone(),
|
||||
init.time_profiler_chan.clone(),
|
||||
script_to_constellation_chan,
|
||||
init.scheduler_chan.clone(),
|
||||
init.resource_threads.clone(),
|
||||
timer_event_chan,
|
||||
MutableOrigin::new(ImmutableOrigin::new_opaque())),
|
||||
base_url: base_url,
|
||||
microtask_queue: MicrotaskQueue::default(),
|
||||
Self {
|
||||
globalscope: GlobalScope::new_inherited(
|
||||
pipeline_id,
|
||||
init.devtools_chan.clone(),
|
||||
init.mem_profiler_chan.clone(),
|
||||
init.time_profiler_chan.clone(),
|
||||
script_to_constellation_chan,
|
||||
init.scheduler_chan.clone(),
|
||||
init.resource_threads.clone(),
|
||||
timer_event_chan,
|
||||
MutableOrigin::new(ImmutableOrigin::new_opaque()),
|
||||
),
|
||||
base_url,
|
||||
microtask_queue: Default::default(),
|
||||
to_script_thread_sender: init.to_script_thread_sender.clone(),
|
||||
executor: executor,
|
||||
executor,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue