mirror of
https://github.com/RGBCube/serenity
synced 2025-05-22 15:45:08 +00:00

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.
30 lines
622 B
C++
30 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;
|
|
|
|
}
|