mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00: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:
parent
509eaca73d
commit
24a5e4e7d5
Notes:
github-actions[bot]
2025-03-13 20:57:59 +00:00
Author: https://github.com/trflynn89
Commit: 24a5e4e7d5
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3920
42 changed files with 162 additions and 146 deletions
|
@ -24,9 +24,9 @@ DeviceActor::DeviceActor(DevToolsServer& devtools, String name)
|
|||
|
||||
DeviceActor::~DeviceActor() = default;
|
||||
|
||||
void DeviceActor::handle_message(StringView type, JsonObject const&)
|
||||
void DeviceActor::handle_message(Message const& message)
|
||||
{
|
||||
if (type == "getDescription"sv) {
|
||||
if (message.type == "getDescription"sv) {
|
||||
auto build_id = Core::Version::read_long_version_string();
|
||||
|
||||
static auto browser_name = String::from_utf8_without_validation({ BROWSER_NAME, __builtin_strlen(BROWSER_NAME) });
|
||||
|
@ -54,7 +54,7 @@ void DeviceActor::handle_message(StringView type, JsonObject const&)
|
|||
return;
|
||||
}
|
||||
|
||||
send_unrecognized_packet_type_error(type);
|
||||
send_unrecognized_packet_type_error(message);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue