mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Introduce GlobalScope::pipeline_id
This commit is contained in:
parent
c6ff767625
commit
27f100b1d4
21 changed files with 103 additions and 85 deletions
|
@ -11,6 +11,7 @@ use dom::crypto::Crypto;
|
|||
use dom::eventtarget::EventTarget;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use js::jsapi::{JS_GetContext, JS_GetObjectRuntime, JSContext};
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use profile_traits::{mem, time};
|
||||
use script_traits::{ScriptMsg as ConstellationMsg, TimerEventRequest};
|
||||
use std::cell::Cell;
|
||||
|
@ -24,6 +25,9 @@ pub struct GlobalScope {
|
|||
crypto: MutNullableHeap<JS<Crypto>>,
|
||||
next_worker_id: Cell<WorkerId>,
|
||||
|
||||
/// Pipeline id associated with this global.
|
||||
pipeline_id: PipelineId,
|
||||
|
||||
/// A flag to indicate whether the developer tools has requested
|
||||
/// live updates from the worker.
|
||||
devtools_wants_updates: Cell<bool>,
|
||||
|
@ -53,6 +57,7 @@ pub struct GlobalScope {
|
|||
|
||||
impl GlobalScope {
|
||||
pub fn new_inherited(
|
||||
pipeline_id: PipelineId,
|
||||
devtools_chan: Option<IpcSender<ScriptToDevtoolsControlMsg>>,
|
||||
mem_profiler_chan: mem::ProfilerChan,
|
||||
time_profiler_chan: time::ProfilerChan,
|
||||
|
@ -63,6 +68,7 @@ impl GlobalScope {
|
|||
eventtarget: EventTarget::new_inherited(),
|
||||
crypto: Default::default(),
|
||||
next_worker_id: Cell::new(WorkerId(0)),
|
||||
pipeline_id: pipeline_id,
|
||||
devtools_wants_updates: Default::default(),
|
||||
console_timers: DOMRefCell::new(Default::default()),
|
||||
devtools_chan: devtools_chan,
|
||||
|
@ -149,6 +155,11 @@ impl GlobalScope {
|
|||
pub fn scheduler_chan(&self) -> &IpcSender<TimerEventRequest> {
|
||||
&self.scheduler_chan
|
||||
}
|
||||
|
||||
/// Get the `PipelineId` for this global scope.
|
||||
pub fn pipeline_id(&self) -> PipelineId {
|
||||
self.pipeline_id
|
||||
}
|
||||
}
|
||||
|
||||
fn timestamp_in_ms(time: Timespec) -> u64 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue