mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-06 11:12:54 +00:00
LibWeb: Use HeapFunction directly in SessionHistoryTraversalQueue
This allows us to use HeapFunction all of the way down, allowing us to remove the Handle usage in after_session_callback for create_new_child_navigable.
This commit is contained in:
parent
b6d2ab2332
commit
fc83653f3c
Notes:
github-actions[bot]
2024-08-18 09:16:10 +00:00
Author: https://github.com/shannonbooth
Commit: fc83653f3c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1108
Reviewed-by: https://github.com/awesomekling
8 changed files with 33 additions and 33 deletions
|
@ -12,9 +12,9 @@ namespace Web::HTML {
|
|||
JS_DEFINE_ALLOCATOR(SessionHistoryTraversalQueue);
|
||||
JS_DEFINE_ALLOCATOR(SessionHistoryTraversalQueueEntry);
|
||||
|
||||
JS::NonnullGCPtr<SessionHistoryTraversalQueueEntry> SessionHistoryTraversalQueueEntry::create(JS::VM& vm, Function<void()> steps, JS::GCPtr<HTML::Navigable> target_navigable)
|
||||
JS::NonnullGCPtr<SessionHistoryTraversalQueueEntry> SessionHistoryTraversalQueueEntry::create(JS::VM& vm, JS::NonnullGCPtr<JS::HeapFunction<void()>> steps, JS::GCPtr<HTML::Navigable> target_navigable)
|
||||
{
|
||||
return vm.heap().allocate_without_realm<SessionHistoryTraversalQueueEntry>(JS::create_heap_function(vm.heap(), move(steps)), target_navigable);
|
||||
return vm.heap().allocate_without_realm<SessionHistoryTraversalQueueEntry>(steps, target_navigable);
|
||||
}
|
||||
|
||||
void SessionHistoryTraversalQueueEntry::visit_edges(JS::Cell::Visitor& visitor)
|
||||
|
@ -46,17 +46,17 @@ void SessionHistoryTraversalQueue::visit_edges(JS::Cell::Visitor& visitor)
|
|||
visitor.visit(m_queue);
|
||||
}
|
||||
|
||||
void SessionHistoryTraversalQueue::append(Function<void()> steps)
|
||||
void SessionHistoryTraversalQueue::append(JS::NonnullGCPtr<JS::HeapFunction<void()>> steps)
|
||||
{
|
||||
m_queue.append(SessionHistoryTraversalQueueEntry::create(vm(), move(steps), nullptr));
|
||||
m_queue.append(SessionHistoryTraversalQueueEntry::create(vm(), steps, nullptr));
|
||||
if (!m_timer->is_active()) {
|
||||
m_timer->start();
|
||||
}
|
||||
}
|
||||
|
||||
void SessionHistoryTraversalQueue::append_sync(Function<void()> steps, JS::GCPtr<Navigable> target_navigable)
|
||||
void SessionHistoryTraversalQueue::append_sync(JS::NonnullGCPtr<JS::HeapFunction<void()>> steps, JS::GCPtr<Navigable> target_navigable)
|
||||
{
|
||||
m_queue.append(SessionHistoryTraversalQueueEntry::create(vm(), move(steps), target_navigable));
|
||||
m_queue.append(SessionHistoryTraversalQueueEntry::create(vm(), steps, target_navigable));
|
||||
if (!m_timer->is_active()) {
|
||||
m_timer->start();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue