mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Timers are scheduled by a dedicated per-constellation thread.
This commit is contained in:
parent
674589c370
commit
553a0dbefd
21 changed files with 786 additions and 334 deletions
|
@ -22,6 +22,8 @@ use msg::constellation_msg::{ConstellationChan, PipelineId, WorkerId};
|
|||
use net_traits::ResourceTask;
|
||||
use profile_traits::mem;
|
||||
use script_task::{CommonScriptMsg, ScriptChan, ScriptPort, ScriptTask};
|
||||
use script_traits::TimerEventRequest;
|
||||
use std::sync::mpsc::Sender;
|
||||
use url::Url;
|
||||
use util::mem::HeapSizeOf;
|
||||
|
||||
|
@ -96,6 +98,14 @@ impl<'a> GlobalRef<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Get the scheduler channel to request timer events.
|
||||
pub fn scheduler_chan(&self) -> Sender<TimerEventRequest> {
|
||||
match *self {
|
||||
GlobalRef::Window(window) => window.scheduler_chan(),
|
||||
GlobalRef::Worker(worker) => worker.scheduler_chan(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Get an `IpcSender<ScriptToDevtoolsControlMsg>` to send messages to Devtools
|
||||
/// task when available.
|
||||
pub fn devtools_chan(&self) -> Option<IpcSender<ScriptToDevtoolsControlMsg>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue