mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-25 18:05:04 +00:00
There is a lot needed all at once to actually inspect a tab's DOM tree. It begins with requesting a "watcher" from a TabActor. It seems there can be many types of watchers, but here we implement the "frame" watcher only. The watcher creates an "inspector", which in turn creates a "walker", which is the actor ultimately responsible for serializing and inspecting the DOM tree. In between all that, the DevTools client will send a handful of other informational requests. If we do not reply to these, the client will not move forward with the walker. For example, the CSSPropertiesActor will be asked for a list of all known CSS properties.
35 lines
844 B
C++
35 lines
844 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 WatcherActor final : public Actor {
|
|
public:
|
|
static constexpr auto base_name = "watcher"sv;
|
|
|
|
static NonnullRefPtr<WatcherActor> create(DevToolsServer&, ByteString name, WeakPtr<TabActor>);
|
|
virtual ~WatcherActor() override;
|
|
|
|
virtual void handle_message(StringView type, JsonObject const&) override;
|
|
|
|
JsonObject serialize_description() const;
|
|
|
|
private:
|
|
WatcherActor(DevToolsServer&, ByteString name, WeakPtr<TabActor>);
|
|
|
|
WeakPtr<TabActor> m_tab;
|
|
WeakPtr<Actor> m_target;
|
|
WeakPtr<TargetConfigurationActor> m_target_configuration;
|
|
WeakPtr<ThreadConfigurationActor> m_thread_configuration;
|
|
};
|
|
|
|
}
|