mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Perform a microtask checkpoint after executing classic scripts and callbacks.
This commit is contained in:
parent
32d4f84a30
commit
b5d2bd757b
7 changed files with 49 additions and 25 deletions
|
@ -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>() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue