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
|
@ -36,7 +36,7 @@ use timers::{IsInterval, TimerId, TimerManager, TimerCallback};
|
|||
|
||||
use devtools_traits::DevtoolsControlChan;
|
||||
use msg::compositor_msg::ScriptListener;
|
||||
use msg::constellation_msg::{LoadData, PipelineId, SubpageId, ConstellationChan, WindowSizeData};
|
||||
use msg::constellation_msg::{LoadData, PipelineId, SubpageId, ConstellationChan, WindowSizeData, WorkerId};
|
||||
use net::image_cache_task::ImageCacheTask;
|
||||
use net::resource_task::ResourceTask;
|
||||
use net::storage_task::{StorageTask, StorageType};
|
||||
|
@ -98,6 +98,8 @@ pub struct Window {
|
|||
local_storage: MutNullableJS<Storage>,
|
||||
timers: TimerManager,
|
||||
|
||||
next_worker_id: Cell<WorkerId>,
|
||||
|
||||
/// For providing instructions to an optional devtools server.
|
||||
devtools_chan: Option<DevtoolsControlChan>,
|
||||
|
||||
|
@ -171,6 +173,13 @@ impl Window {
|
|||
self.script_chan.clone()
|
||||
}
|
||||
|
||||
pub fn get_next_worker_id(&self) -> WorkerId {
|
||||
let worker_id = self.next_worker_id.get();
|
||||
let WorkerId(id_num) = worker_id;
|
||||
self.next_worker_id.set(WorkerId(id_num + 1));
|
||||
worker_id
|
||||
}
|
||||
|
||||
pub fn pipeline(&self) -> PipelineId {
|
||||
self.id
|
||||
}
|
||||
|
@ -814,6 +823,7 @@ impl Window {
|
|||
session_storage: Default::default(),
|
||||
local_storage: Default::default(),
|
||||
timers: TimerManager::new(),
|
||||
next_worker_id: Cell::new(WorkerId(0)),
|
||||
id: id,
|
||||
parent_info: parent_info,
|
||||
dom_static: GlobalStaticData::new(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue