mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
3d3a5b431f
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.
31 lines
622 B
C++
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;
|
|
|
|
}
|