mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
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.
45 lines
1.1 KiB
C++
45 lines
1.1 KiB
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>
|
|
#include <LibWeb/CSS/Selector.h>
|
|
#include <LibWeb/Forward.h>
|
|
|
|
namespace DevTools {
|
|
|
|
struct NodeIdentifier {
|
|
static NodeIdentifier for_node(JsonObject const& node);
|
|
|
|
bool operator==(NodeIdentifier const&) const = default;
|
|
|
|
Web::UniqueNodeID id { 0 };
|
|
Optional<Web::CSS::Selector::PseudoElement::Type> pseudo_element;
|
|
};
|
|
|
|
class NodeActor final : public Actor {
|
|
public:
|
|
static constexpr auto base_name = "node"sv;
|
|
|
|
static NonnullRefPtr<NodeActor> create(DevToolsServer&, String name, NodeIdentifier, WeakPtr<WalkerActor>);
|
|
virtual ~NodeActor() override;
|
|
|
|
NodeIdentifier const& node_identifier() const { return m_node_identifier; }
|
|
|
|
private:
|
|
NodeActor(DevToolsServer&, String name, NodeIdentifier, WeakPtr<WalkerActor>);
|
|
|
|
virtual void handle_message(Message const&) override;
|
|
|
|
NodeIdentifier m_node_identifier;
|
|
|
|
WeakPtr<WalkerActor> m_walker;
|
|
};
|
|
|
|
}
|