mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 07:41:01 +00:00
LibDevTools: Automatically set the "from" field for server responses
The "from" field is required in every response. It is the name of the actor sending the message. This patch fills in the "from" field in the Actor base class so that subclasses don't have to.
This commit is contained in:
parent
a7b577126a
commit
4ce10f3bf4
Notes:
github-actions[bot]
2025-03-12 16:49:10 +00:00
Author: https://github.com/trflynn89
Commit: 4ce10f3bf4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3904
19 changed files with 19 additions and 76 deletions
|
@ -31,7 +31,6 @@ PageStyleActor::~PageStyleActor() = default;
|
|||
void PageStyleActor::handle_message(StringView type, JsonObject const& message)
|
||||
{
|
||||
JsonObject response;
|
||||
response.set("from"sv, name());
|
||||
|
||||
if (type == "getApplied"sv) {
|
||||
// FIXME: This provides information to the "styles" pane in the inspector tab, which allows toggling and editing
|
||||
|
@ -119,7 +118,6 @@ void PageStyleActor::inspect_dom_node(StringView node_actor, Callback&& callback
|
|||
void PageStyleActor::received_layout(JsonObject const& computed_style, JsonObject const& node_box_sizing, BlockToken block_token)
|
||||
{
|
||||
JsonObject message;
|
||||
message.set("from"sv, name());
|
||||
message.set("autoMargins"sv, JsonObject {});
|
||||
|
||||
auto pixel_value = [&](auto const& object, auto key) {
|
||||
|
@ -175,7 +173,6 @@ void PageStyleActor::received_computed_style(JsonObject const& computed_style, B
|
|||
});
|
||||
|
||||
JsonObject message;
|
||||
message.set("from"sv, name());
|
||||
message.set("computed"sv, move(computed));
|
||||
send_message(move(message), move(block_token));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue