mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-16 23:39:44 +00:00
LibWeb: Port populate_session_history_entry_document to HeapFunction
...For the completion steps. This is quite nice, as we can simply capture this in the heap function where it is used instead of needing to establish a new root. Note that with these changes, to represent 'an empty algorithm', we now use a null HeapFunction and do not invoke the steps.
This commit is contained in:
parent
3a7ccf8c25
commit
b6d2ab2332
Notes:
github-actions[bot]
2024-08-18 09:16:15 +00:00
Author: https://github.com/shannonbooth
Commit: b6d2ab2332
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1108
Reviewed-by: https://github.com/awesomekling
3 changed files with 17 additions and 12 deletions
|
@ -619,11 +619,11 @@ TraversableNavigable::HistoryStepResult TraversableNavigable::apply_the_history_
|
|||
// targetSnapshotParams, with allowPOST set to allowPOST and completionSteps set to queue a global task on the navigation and traversal task source given
|
||||
// navigable's active window to run afterDocumentPopulated.
|
||||
Platform::EventLoopPlugin::the().deferred_invoke([populated_target_entry, potentially_target_specific_source_snapshot_params, target_snapshot_params, this, allow_POST, navigable, after_document_populated = JS::create_heap_function(this->heap(), move(after_document_populated))] {
|
||||
navigable->populate_session_history_entry_document(populated_target_entry, *potentially_target_specific_source_snapshot_params, target_snapshot_params, {}, Empty {}, CSPNavigationType::Other, allow_POST, [this, after_document_populated, populated_target_entry]() mutable {
|
||||
navigable->populate_session_history_entry_document(populated_target_entry, *potentially_target_specific_source_snapshot_params, target_snapshot_params, {}, Empty {}, CSPNavigationType::Other, allow_POST, JS::create_heap_function(this->heap(), [this, after_document_populated, populated_target_entry]() mutable {
|
||||
queue_global_task(Task::Source::NavigationAndTraversal, *active_window(), JS::create_heap_function(this->heap(), [after_document_populated, populated_target_entry]() mutable {
|
||||
after_document_populated->function()(true, populated_target_entry);
|
||||
}));
|
||||
})
|
||||
}))
|
||||
.release_value_but_fixme_should_propagate_errors();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue