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:
bors-servo 2016-09-10 07:33:25 -05:00 committed by GitHub
commit 84f3cf22bf
16 changed files with 223 additions and 120 deletions

View file

@ -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 {