mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Auto merge of #13185 - nox:namespaces, r=jdm,Ms2ger
Make console a namespace (fixes #13010) <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13185) <!-- Reviewable:end -->
This commit is contained in:
commit
84f3cf22bf
16 changed files with 223 additions and 120 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