mirror of
https://github.com/servo/servo.git
synced 2025-09-10 15:08:21 +01:00
Fix step ordering for MicrotaskQueue checkpoint (#39099)
The steps were incorrectly numbered, this PR fixes that and copies over the description of each step. Testing: None, just expanding on the comments/fixing the step numbering --------- Signed-off-by: Ashwin Naren <arihant2math@gmail.com> Co-authored-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
This commit is contained in:
parent
9c840b05bc
commit
4dcf4ef07a
1 changed files with 11 additions and 5 deletions
|
@ -93,16 +93,17 @@ impl MicrotaskQueue {
|
|||
) where
|
||||
F: Fn(PipelineId) -> Option<DomRoot<GlobalScope>>,
|
||||
{
|
||||
// Step 1. If the event loop's performing a microtask checkpoint is true, then return.
|
||||
if self.performing_a_microtask_checkpoint.get() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Step 1
|
||||
// Step 2. Set the event loop's performing a microtask checkpoint to true.
|
||||
self.performing_a_microtask_checkpoint.set(true);
|
||||
|
||||
debug!("Now performing a microtask checkpoint");
|
||||
|
||||
// Steps 2
|
||||
// Step 3. While the event loop's microtask queue is not empty:
|
||||
while !self.microtask_queue.borrow().is_empty() {
|
||||
rooted_vec!(let mut pending_queue);
|
||||
mem::swap(&mut *pending_queue, &mut *self.microtask_queue.borrow_mut());
|
||||
|
@ -154,15 +155,20 @@ impl MicrotaskQueue {
|
|||
}
|
||||
}
|
||||
|
||||
// Step 3
|
||||
// Step 4. For each environment settings object settingsObject whose responsible
|
||||
// event loop is this event loop, notify about rejected promises given
|
||||
// settingsObject's global object.
|
||||
for global in globalscopes.into_iter() {
|
||||
notify_about_rejected_promises(&global);
|
||||
}
|
||||
|
||||
// TODO: Step 4 - Cleanup Indexed Database transactions.
|
||||
// TODO: Step 5. Cleanup Indexed Database transactions.
|
||||
|
||||
// Step 5
|
||||
// TODO: Step 6. Perform ClearKeptObjects().
|
||||
|
||||
// Step 7. Set the event loop's performing a microtask checkpoint to false.
|
||||
self.performing_a_microtask_checkpoint.set(false);
|
||||
// TODO: Step 8. Record timing info for microtask checkpoint.
|
||||
}
|
||||
|
||||
pub(crate) fn empty(&self) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue