mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Notify devtools about new worker globals
This commit is contained in:
parent
5dd43bf84c
commit
1244f9e016
10 changed files with 117 additions and 14 deletions
|
@ -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 {
|
||||
|
|
|
@ -47,7 +47,7 @@ use js::jsval::JSVal;
|
|||
use js::rust::{Cx, rt};
|
||||
use layout_interface::{LayoutRPC, LayoutChan};
|
||||
use libc;
|
||||
use msg::constellation_msg::{PipelineId, SubpageId, WindowSizeData};
|
||||
use msg::constellation_msg::{PipelineId, SubpageId, WindowSizeData, WorkerId};
|
||||
use net::image_cache_task::ImageCacheTask;
|
||||
use net::storage_task::StorageType;
|
||||
use script_traits::ScriptControlChan;
|
||||
|
@ -242,6 +242,7 @@ no_jsmanaged_fields!(PropertyDeclarationBlock);
|
|||
// These three are interdependent, if you plan to put jsmanaged data
|
||||
// in one of these make sure it is propagated properly to containing structs
|
||||
no_jsmanaged_fields!(SubpageId, WindowSizeData, PipelineId);
|
||||
no_jsmanaged_fields!(WorkerId);
|
||||
no_jsmanaged_fields!(QuirksMode);
|
||||
no_jsmanaged_fields!(Cx);
|
||||
no_jsmanaged_fields!(rt);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue