mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Store Console timers in globals
This commit is contained in:
parent
20b131af17
commit
7a942b1742
4 changed files with 67 additions and 21 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue