Introduce GlobalScope::live_devtools_updates

This commit is contained in:
Anthony Ramine 2016-09-27 14:39:44 +02:00
parent 3e5c0c386c
commit d7c2da450b
8 changed files with 20 additions and 37 deletions

View file

@ -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);
}
}