mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Introduce GlobalScope::live_devtools_updates
This commit is contained in:
parent
3e5c0c386c
commit
d7c2da450b
8 changed files with 20 additions and 37 deletions
|
@ -15,6 +15,10 @@ pub struct GlobalScope {
|
|||
eventtarget: EventTarget,
|
||||
crypto: MutNullableHeap<JS<Crypto>>,
|
||||
next_worker_id: Cell<WorkerId>,
|
||||
|
||||
/// A flag to indicate whether the developer tools has requested
|
||||
/// live updates from the worker.
|
||||
devtools_wants_updates: Cell<bool>,
|
||||
}
|
||||
|
||||
impl GlobalScope {
|
||||
|
@ -23,6 +27,7 @@ impl GlobalScope {
|
|||
eventtarget: EventTarget::new_inherited(),
|
||||
crypto: Default::default(),
|
||||
next_worker_id: Cell::new(WorkerId(0)),
|
||||
devtools_wants_updates: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,4 +54,12 @@ impl GlobalScope {
|
|||
self.next_worker_id.set(WorkerId(id_num + 1));
|
||||
worker_id
|
||||
}
|
||||
|
||||
pub fn live_devtools_updates(&self) -> bool {
|
||||
self.devtools_wants_updates.get()
|
||||
}
|
||||
|
||||
pub fn set_devtools_wants_updates(&self, value: bool) {
|
||||
self.devtools_wants_updates.set(value);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue