mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +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 {
|
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(
|
||||||
base_url: ServoUrl,
|
pipeline_id: PipelineId,
|
||||||
executor: WorkletExecutor,
|
base_url: ServoUrl,
|
||||||
init: &WorkletGlobalScopeInit)
|
executor: WorkletExecutor,
|
||||||
-> WorkletGlobalScope {
|
init: &WorkletGlobalScopeInit,
|
||||||
|
) -> 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(
|
||||||
init.devtools_chan.clone(),
|
pipeline_id,
|
||||||
init.mem_profiler_chan.clone(),
|
init.devtools_chan.clone(),
|
||||||
init.time_profiler_chan.clone(),
|
init.mem_profiler_chan.clone(),
|
||||||
script_to_constellation_chan,
|
init.time_profiler_chan.clone(),
|
||||||
init.scheduler_chan.clone(),
|
script_to_constellation_chan,
|
||||||
init.resource_threads.clone(),
|
init.scheduler_chan.clone(),
|
||||||
timer_event_chan,
|
init.resource_threads.clone(),
|
||||||
MutableOrigin::new(ImmutableOrigin::new_opaque())),
|
timer_event_chan,
|
||||||
base_url: base_url,
|
MutableOrigin::new(ImmutableOrigin::new_opaque()),
|
||||||
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,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue