Notify devtools about new worker globals

This commit is contained in:
Thiago Pontes 2015-03-27 16:04:53 -03:00
parent 5dd43bf84c
commit 1244f9e016
10 changed files with 117 additions and 14 deletions

View file

@ -14,6 +14,8 @@ use dom::workerglobalscope::{WorkerGlobalScope, WorkerGlobalScopeHelpers};
use dom::window::{self, WindowHelpers};
use script_task::ScriptChan;
use msg::constellation_msg::WorkerId;
use net::resource_task::ResourceTask;
use js::{JSCLASS_IS_GLOBAL, JSCLASS_IS_DOMJSCLASS};
@ -89,6 +91,14 @@ impl<'a> GlobalRef<'a> {
}
}
/// Get next worker id.
pub fn get_next_worker_id(&self) -> WorkerId {
match *self {
GlobalRef::Window(ref window) => window.get_next_worker_id(),
GlobalRef::Worker(ref worker) => worker.get_next_worker_id()
}
}
/// Get the URL for this global scope.
pub fn get_url(&self) -> Url {
match *self {