diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2016-09-27 14:39:44 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2016-10-06 20:59:10 +0200 |
commit | d7c2da450bb7a4e1b393c1260cd13ec658d408f0 (patch) | |
tree | 7a4395008bbc5e4df8b6ada7147da4888af767d4 /components/script/dom/globalscope.rs | |
parent | 3e5c0c386c425e51067038228561e78d10c80a53 (diff) | |
download | servo-d7c2da450bb7a4e1b393c1260cd13ec658d408f0.tar.gz servo-d7c2da450bb7a4e1b393c1260cd13ec658d408f0.zip |
Introduce GlobalScope::live_devtools_updates
Diffstat (limited to 'components/script/dom/globalscope.rs')
-rw-r--r-- | components/script/dom/globalscope.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/components/script/dom/globalscope.rs b/components/script/dom/globalscope.rs index a09e727f772..e5f42c3f9ed 100644 --- a/components/script/dom/globalscope.rs +++ b/components/script/dom/globalscope.rs @@ -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); + } } |