Introduce GlobalScope::flush_promise_jobs

This commit is contained in:
Anthony Ramine 2016-10-04 16:00:40 +02:00
parent 44ca9f3d71
commit 6e3be6d894
4 changed files with 16 additions and 13 deletions

View file

@ -92,15 +92,6 @@ impl<'a> GlobalRef<'a> {
GlobalRef::Worker(ref worker) => worker.enqueue_promise_job(job),
}
}
/// Start the process of executing the pending promise callbacks. They will be invoked
/// in FIFO order, synchronously, at some point in the future.
pub fn flush_promise_jobs(&self) {
match *self {
GlobalRef::Window(_) => ScriptThread::flush_promise_jobs(*self),
GlobalRef::Worker(ref worker) => worker.flush_promise_jobs(),
}
}
}
impl<'a> Reflectable for GlobalRef<'a> {