ladybird/Userland/Services/InspectorServer/InspectableProcess.h
Andreas Kling 3d3a5b431f Services: Add InspectorServer to reverse the direction of Inspector
This service daemon will act as an intermediary between the Inspector
program and the inspectable programs it wants to inspect.

Programs can make themselves available for inspection by connecting
to /tmp/portal/inspectables using the Core::EventLoop RPC protocol.
2021-05-13 23:28:40 +02:00

31 lines
622 B
C++

/*
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibCore/LocalSocket.h>
namespace InspectorServer {
class InspectableProcess {
public:
InspectableProcess(pid_t, NonnullRefPtr<Core::LocalSocket>);
~InspectableProcess();
void send_request(JsonObject const& request);
String wait_for_response();
static InspectableProcess* from_pid(pid_t);
private:
pid_t m_pid { 0 };
NonnullRefPtr<Core::LocalSocket> m_socket;
};
extern HashMap<pid_t, NonnullOwnPtr<InspectorServer::InspectableProcess>> g_processes;
}