Perform a microtask checkpoint after executing classic scripts and callbacks.

This commit is contained in:
Josh Matthews 2017-01-12 12:53:53 -05:00
parent 32d4f84a30
commit b5d2bd757b
7 changed files with 49 additions and 25 deletions

View file

@ -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>() {