diff options
author | Josh Matthews <josh@joshmatthews.net> | 2017-01-12 12:53:53 -0500 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2017-02-01 12:54:33 -0500 |
commit | b5d2bd757b45aa7f1e61c947d883eb977c6ad7af (patch) | |
tree | a43aaa5c69190004106f8fb49a29a06326cc77d4 /components/script/dom/globalscope.rs | |
parent | 32d4f84a30035b6b1094f7e68adbe1e6a883bb9b (diff) | |
download | servo-b5d2bd757b45aa7f1e61c947d883eb977c6ad7af.tar.gz servo-b5d2bd757b45aa7f1e61c947d883eb977c6ad7af.zip |
Perform a microtask checkpoint after executing classic scripts and callbacks.
Diffstat (limited to 'components/script/dom/globalscope.rs')
-rw-r--r-- | components/script/dom/globalscope.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/components/script/dom/globalscope.rs b/components/script/dom/globalscope.rs index aaebf091c6d..cc42ef18d06 100644 --- a/components/script/dom/globalscope.rs +++ b/components/script/dom/globalscope.rs @@ -449,6 +449,17 @@ impl GlobalScope { unreachable!(); } + /// Perform a microtask checkpoint. + pub fn perform_a_microtask_checkpoint(&self) { + if self.is::<Window>() { + return ScriptThread::invoke_perform_a_microtask_checkpoint(); + } + if let Some(worker) = self.downcast::<WorkerGlobalScope>() { + return worker.perform_a_microtask_checkpoint(); + } + unreachable!(); + } + /// Enqueue a microtask for subsequent execution. pub fn enqueue_microtask(&self, job: Microtask) { if self.is::<Window>() { |