mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +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
|
@ -54,7 +54,6 @@ FrameActor::~FrameActor()
|
|||
void FrameActor::handle_message(StringView type, JsonObject const&)
|
||||
{
|
||||
JsonObject response;
|
||||
response.set("from"sv, name());
|
||||
|
||||
if (type == "detach"sv) {
|
||||
if (auto tab = m_tab.strong_ref()) {
|
||||
|
@ -88,7 +87,6 @@ void FrameActor::send_frame_update_message()
|
|||
}
|
||||
|
||||
JsonObject message;
|
||||
message.set("from"sv, name());
|
||||
message.set("type"sv, "frameUpdate"sv);
|
||||
message.set("frames"sv, move(frames));
|
||||
send_message(move(message));
|
||||
|
@ -198,7 +196,6 @@ void FrameActor::console_messages_received(i32 start_index, Vector<WebView::Cons
|
|||
array.must_append(move(console_message));
|
||||
|
||||
JsonObject message;
|
||||
message.set("from"sv, name());
|
||||
message.set("type"sv, "resources-available-array"sv);
|
||||
message.set("array"sv, move(array));
|
||||
send_message(move(message));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue