mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 04:37:55 +00:00
The DevTools client will now send requests to the node actor, rather than just sending messages to other actors on the node's behalf. This exposed a slight issue in the way we assign actor IDs. Node actors are created in the walker actor constructor, which executes before the actor ID is incremented. So we must be sure to increment the actor ID before invoking any actor constructors. Otherwise, the walker actor and the first node actor have the same numeric ID.
30 lines
633 B
C++
30 lines
633 B
C++
/*
|
|
* Copyright (c) 2025, Tim Flynn <trflynn89@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/NonnullRefPtr.h>
|
|
#include <LibDevTools/Actor.h>
|
|
|
|
namespace DevTools {
|
|
|
|
class NodeActor final : public Actor {
|
|
public:
|
|
static constexpr auto base_name = "node"sv;
|
|
|
|
static NonnullRefPtr<NodeActor> create(DevToolsServer&, String name, WeakPtr<WalkerActor>);
|
|
virtual ~NodeActor() override;
|
|
|
|
virtual void handle_message(StringView type, JsonObject const&) override;
|
|
|
|
private:
|
|
NodeActor(DevToolsServer&, String name, WeakPtr<WalkerActor>);
|
|
|
|
WeakPtr<WalkerActor> m_walker;
|
|
};
|
|
|
|
}
|