diff options
author | benshu <benshu@benshu.de> | 2015-08-30 01:45:07 +0200 |
---|---|---|
committer | benshu <benshu@benshu.de> | 2015-10-21 16:40:49 +0200 |
commit | 553a0dbefd8a8724f7c894b1c25e6c15c35d6d04 (patch) | |
tree | 8f49ff753b6f91397865a26f4bd8c14a12377e96 /components/script/dom/bindings/global.rs | |
parent | 674589c370d978f543e71f995d58c5b28e6e9842 (diff) | |
download | servo-553a0dbefd8a8724f7c894b1c25e6c15c35d6d04.tar.gz servo-553a0dbefd8a8724f7c894b1c25e6c15c35d6d04.zip |
Timers are scheduled by a dedicated per-constellation thread.
Diffstat (limited to 'components/script/dom/bindings/global.rs')
-rw-r--r-- | components/script/dom/bindings/global.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/components/script/dom/bindings/global.rs b/components/script/dom/bindings/global.rs index d45d3b154b1..cfb1acb99e9 100644 --- a/components/script/dom/bindings/global.rs +++ b/components/script/dom/bindings/global.rs @@ -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>> { |