mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-05 02:33:03 +00:00
LibWeb: Let queue_global_task() take a JS::HeapFunction
Changes the signature of queue_global_task() from AK:Function to JS::HeapFunction to be more clear to the user of the function that this is what it uses internally.
This commit is contained in:
parent
9540af6489
commit
a3661fd7f2
Notes:
sideshowbarker
2024-07-17 03:05:16 +09:00
Author: https://github.com/kennethmyhra
Commit: a3661fd7f2
Pull-request: https://github.com/SerenityOS/serenity/pull/24026
23 changed files with 104 additions and 103 deletions
|
@ -252,14 +252,14 @@ ErrorOr<void> MessagePort::send_message_on_socket(SerializedTransferRecord const
|
|||
void MessagePort::post_port_message(SerializedTransferRecord serialize_with_transfer_result)
|
||||
{
|
||||
// FIXME: Use the correct task source?
|
||||
queue_global_task(Task::Source::PostedMessage, relevant_global_object(*this), [this, serialize_with_transfer_result = move(serialize_with_transfer_result)]() mutable {
|
||||
queue_global_task(Task::Source::PostedMessage, relevant_global_object(*this), JS::create_heap_function(heap(), [this, serialize_with_transfer_result = move(serialize_with_transfer_result)]() mutable {
|
||||
if (!m_socket || !m_socket->is_open())
|
||||
return;
|
||||
if (auto result = send_message_on_socket(serialize_with_transfer_result); result.is_error()) {
|
||||
dbgln("Failed to post message: {}", result.error());
|
||||
disentangle();
|
||||
}
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
ErrorOr<MessagePort::ParseDecision> MessagePort::parse_message()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue