diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2016-09-06 15:32:09 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2016-09-07 15:48:22 +0200 |
commit | 7a942b1742db82b6425edc2cb0579fa1a3b003ad (patch) | |
tree | 50506ca014fdc1c508750d0173b8486e8e057679 /components/script/dom/bindings/global.rs | |
parent | 20b131af172ac07ebc817bc24b3601d27a939646 (diff) | |
download | servo-7a942b1742db82b6425edc2cb0579fa1a3b003ad.tar.gz servo-7a942b1742db82b6425edc2cb0579fa1a3b003ad.zip |
Store Console timers in globals
Diffstat (limited to 'components/script/dom/bindings/global.rs')
-rw-r--r-- | components/script/dom/bindings/global.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/components/script/dom/bindings/global.rs b/components/script/dom/bindings/global.rs index 54efb11250d..1eed5473a39 100644 --- a/components/script/dom/bindings/global.rs +++ b/components/script/dom/bindings/global.rs @@ -13,6 +13,7 @@ use dom::bindings::conversions::root_from_object; use dom::bindings::error::ErrorInfo; use dom::bindings::js::Root; use dom::bindings::reflector::{Reflectable, Reflector}; +use dom::console::TimerSet; use dom::window::{self, ScriptHelpers}; use dom::workerglobalscope::WorkerGlobalScope; use ipc_channel::ipc::IpcSender; @@ -271,6 +272,14 @@ impl<'a> GlobalRef<'a> { } } + /// Returns the global's timers for the Console API. + pub fn console_timers(&self) -> &TimerSet { + match *self { + GlobalRef::Window(ref window) => window.console_timers(), + GlobalRef::Worker(ref worker) => worker.console_timers(), + } + } + /// Returns a wrapper for runnables to ensure they are cancelled if the global /// is being destroyed. pub fn get_runnable_wrapper(&self) -> RunnableWrapper { |