mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibIPC: Remove socket path from IPC Client connections
We don't need these for Ladybird, and they are the only users of some LibCore functions we can remove as well.
This commit is contained in:
parent
310cdc35f0
commit
1549d393b9
Notes:
github-actions[bot]
2024-11-26 10:01:57 +00:00
Author: https://github.com/ADKaster
Commit: 1549d393b9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2582
5 changed files with 4 additions and 18 deletions
|
@ -11,20 +11,6 @@
|
||||||
|
|
||||||
namespace IPC {
|
namespace IPC {
|
||||||
|
|
||||||
#define IPC_CLIENT_CONNECTION(klass, socket_path) \
|
|
||||||
C_OBJECT_ABSTRACT(klass) \
|
|
||||||
public: \
|
|
||||||
template<typename Klass = klass, class... Args> \
|
|
||||||
static ErrorOr<NonnullRefPtr<klass>> try_create(Args&&... args) \
|
|
||||||
{ \
|
|
||||||
auto parsed_socket_path = TRY(Core::SessionManagement::parse_path_with_sid(socket_path)); \
|
|
||||||
auto socket = TRY(Core::LocalSocket::connect(move(parsed_socket_path))); \
|
|
||||||
/* We want to rate-limit our clients */ \
|
|
||||||
TRY(socket->set_blocking(true)); \
|
|
||||||
\
|
|
||||||
return adopt_nonnull_ref_or_enomem(new (nothrow) Klass(IPC::Transport(move(socket)), forward<Args>(args)...)); \
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename ClientEndpoint, typename ServerEndpoint>
|
template<typename ClientEndpoint, typename ServerEndpoint>
|
||||||
class ConnectionToServer : public IPC::Connection<ClientEndpoint, ServerEndpoint>
|
class ConnectionToServer : public IPC::Connection<ClientEndpoint, ServerEndpoint>
|
||||||
, public ClientEndpoint::Stub
|
, public ClientEndpoint::Stub
|
||||||
|
|
|
@ -29,7 +29,7 @@ struct DecodedImage {
|
||||||
class Client final
|
class Client final
|
||||||
: public IPC::ConnectionToServer<ImageDecoderClientEndpoint, ImageDecoderServerEndpoint>
|
: public IPC::ConnectionToServer<ImageDecoderClientEndpoint, ImageDecoderServerEndpoint>
|
||||||
, public ImageDecoderClientEndpoint {
|
, public ImageDecoderClientEndpoint {
|
||||||
IPC_CLIENT_CONNECTION(Client, "/tmp/session/%sid/portal/image"sv);
|
C_OBJECT_ABSTRACT(Client);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Client(IPC::Transport);
|
Client(IPC::Transport);
|
||||||
|
|
|
@ -21,7 +21,7 @@ class Request;
|
||||||
class RequestClient final
|
class RequestClient final
|
||||||
: public IPC::ConnectionToServer<RequestClientEndpoint, RequestServerEndpoint>
|
: public IPC::ConnectionToServer<RequestClientEndpoint, RequestServerEndpoint>
|
||||||
, public RequestClientEndpoint {
|
, public RequestClientEndpoint {
|
||||||
IPC_CLIENT_CONNECTION(RequestClient, "/tmp/session/%sid/portal/request"sv)
|
C_OBJECT_ABSTRACT(RequestClient)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit RequestClient(IPC::Transport);
|
explicit RequestClient(IPC::Transport);
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace Web::HTML {
|
||||||
class WebWorkerClient final
|
class WebWorkerClient final
|
||||||
: public IPC::ConnectionToServer<WebWorkerClientEndpoint, WebWorkerServerEndpoint>
|
: public IPC::ConnectionToServer<WebWorkerClientEndpoint, WebWorkerServerEndpoint>
|
||||||
, public WebWorkerClientEndpoint {
|
, public WebWorkerClientEndpoint {
|
||||||
IPC_CLIENT_CONNECTION(WebWorkerClient, "/tmp/session/%sid/portal/webworker"sv);
|
C_OBJECT_ABSTRACT(WebWorkerClient);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit WebWorkerClient(IPC::Transport);
|
explicit WebWorkerClient(IPC::Transport);
|
||||||
|
|
|
@ -26,7 +26,7 @@ class ViewImplementation;
|
||||||
class WebContentClient final
|
class WebContentClient final
|
||||||
: public IPC::ConnectionToServer<WebContentClientEndpoint, WebContentServerEndpoint>
|
: public IPC::ConnectionToServer<WebContentClientEndpoint, WebContentServerEndpoint>
|
||||||
, public WebContentClientEndpoint {
|
, public WebContentClientEndpoint {
|
||||||
IPC_CLIENT_CONNECTION(WebContentClient, "/tmp/session/%sid/portal/webcontent"sv);
|
C_OBJECT_ABSTRACT(WebContentClient);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Optional<ViewImplementation&> view_for_pid_and_page_id(pid_t pid, u64 page_id);
|
static Optional<ViewImplementation&> view_for_pid_and_page_id(pid_t pid, u64 page_id);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue