mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 02:40:49 +00:00
LibWeb: Make HTML::Task IDs a sequential, distinct numeric type
This also fixes a bug where task IDs were being deallocated from the wrong IDAllocator. I don't know if it was actually possible to cause any real trouble with that mistake, nor do I know how to write a test for it, but this makes the bug go away.
This commit is contained in:
committed by
Andreas Kling
parent
0e1256e5a4
commit
08d60d7521
@@ -384,7 +384,7 @@ void EventLoop::process()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task
|
||||
int queue_a_task(HTML::Task::Source source, JS::GCPtr<EventLoop> event_loop, JS::GCPtr<DOM::Document> document, JS::NonnullGCPtr<JS::HeapFunction<void()>> steps)
|
||||
TaskID queue_a_task(HTML::Task::Source source, JS::GCPtr<EventLoop> event_loop, JS::GCPtr<DOM::Document> document, JS::NonnullGCPtr<JS::HeapFunction<void()>> steps)
|
||||
{
|
||||
// 1. If event loop was not given, set event loop to the implied event loop.
|
||||
if (!event_loop)
|
||||
@@ -409,7 +409,7 @@ int queue_a_task(HTML::Task::Source source, JS::GCPtr<EventLoop> event_loop, JS:
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-global-task
|
||||
int queue_global_task(HTML::Task::Source source, JS::Object& global_object, JS::NonnullGCPtr<JS::HeapFunction<void()>> steps)
|
||||
TaskID queue_global_task(HTML::Task::Source source, JS::Object& global_object, JS::NonnullGCPtr<JS::HeapFunction<void()>> steps)
|
||||
{
|
||||
// 1. Let event loop be global's relevant agent's event loop.
|
||||
auto& global_custom_data = verify_cast<Bindings::WebEngineCustomData>(*global_object.vm().custom_data());
|
||||
|
||||
Reference in New Issue
Block a user