mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibDevTools: Move message data into a structure
This is to prepare for an upcoming change where we will need to track replies to messages by ID. We will be able to add parameters to this structure without having to edit every single actor subclass header file.
This commit is contained in:
Notes:
github-actions[bot]
2025-03-13 20:57:59 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/24a5e4e7d57 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3920
@@ -70,8 +70,8 @@ ErrorOr<void> DevToolsServer::on_new_client()
|
||||
close_connection();
|
||||
};
|
||||
|
||||
m_connection->on_message_received = [this](auto const& message) {
|
||||
on_message_received(message);
|
||||
m_connection->on_message_received = [this](auto message) {
|
||||
on_message_received(move(message));
|
||||
};
|
||||
|
||||
m_root_actor = register_actor<RootActor>();
|
||||
@@ -83,7 +83,7 @@ ErrorOr<void> DevToolsServer::on_new_client()
|
||||
return {};
|
||||
}
|
||||
|
||||
void DevToolsServer::on_message_received(JsonObject const& message)
|
||||
void DevToolsServer::on_message_received(JsonObject message)
|
||||
{
|
||||
auto to = message.get_string("to"sv);
|
||||
if (!to.has_value()) {
|
||||
@@ -103,7 +103,7 @@ void DevToolsServer::on_message_received(JsonObject const& message)
|
||||
return;
|
||||
}
|
||||
|
||||
actor->value->handle_message(*type, message);
|
||||
actor->value->message_received(*type, move(message));
|
||||
}
|
||||
|
||||
void DevToolsServer::close_connection()
|
||||
|
||||
Reference in New Issue
Block a user