1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:47:46 +00:00

Userland: Rename IPC ClientConnection => ConnectionFromClient

This was done with CLion's automatic rename feature and with:
find . -name ClientConnection.h
    | rename 's/ClientConnection\.h/ConnectionFromClient.h/'

find . -name ClientConnection.cpp
    | rename 's/ClientConnection\.cpp/ConnectionFromClient.cpp/'
This commit is contained in:
Itamar 2022-02-25 12:18:30 +02:00 committed by Andreas Kling
parent efac862570
commit 3a71748e5d
137 changed files with 896 additions and 896 deletions

View file

@ -8,7 +8,7 @@ compile_ipc(LaunchServer.ipc LaunchServerEndpoint.h)
compile_ipc(LaunchClient.ipc LaunchClientEndpoint.h)
set(SOURCES
ClientConnection.cpp
ConnectionFromClient.cpp
Launcher.cpp
main.cpp
LaunchClientEndpoint.h

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "ClientConnection.h"
#include "ConnectionFromClient.h"
#include "Launcher.h"
#include <AK/HashMap.h>
#include <AK/URL.h>
@ -12,23 +12,23 @@
namespace LaunchServer {
static HashMap<int, RefPtr<ClientConnection>> s_connections;
ClientConnection::ClientConnection(NonnullOwnPtr<Core::Stream::LocalSocket> client_socket, int client_id)
: IPC::ClientConnection<LaunchClientEndpoint, LaunchServerEndpoint>(*this, move(client_socket), client_id)
static HashMap<int, RefPtr<ConnectionFromClient>> s_connections;
ConnectionFromClient::ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSocket> client_socket, int client_id)
: IPC::ConnectionFromClient<LaunchClientEndpoint, LaunchServerEndpoint>(*this, move(client_socket), client_id)
{
s_connections.set(client_id, *this);
}
ClientConnection::~ClientConnection()
ConnectionFromClient::~ConnectionFromClient()
{
}
void ClientConnection::die()
void ConnectionFromClient::die()
{
s_connections.remove(client_id());
}
Messages::LaunchServer::OpenUrlResponse ClientConnection::open_url(URL const& url, String const& handler_name)
Messages::LaunchServer::OpenUrlResponse ConnectionFromClient::open_url(URL const& url, String const& handler_name)
{
if (!m_allowlist.is_empty()) {
bool allowed = false;
@ -51,17 +51,17 @@ Messages::LaunchServer::OpenUrlResponse ClientConnection::open_url(URL const& ur
return Launcher::the().open_url(url, handler_name);
}
Messages::LaunchServer::GetHandlersForUrlResponse ClientConnection::get_handlers_for_url(URL const& url)
Messages::LaunchServer::GetHandlersForUrlResponse ConnectionFromClient::get_handlers_for_url(URL const& url)
{
return Launcher::the().handlers_for_url(url);
}
Messages::LaunchServer::GetHandlersWithDetailsForUrlResponse ClientConnection::get_handlers_with_details_for_url(URL const& url)
Messages::LaunchServer::GetHandlersWithDetailsForUrlResponse ConnectionFromClient::get_handlers_with_details_for_url(URL const& url)
{
return Launcher::the().handlers_with_details_for_url(url);
}
void ClientConnection::add_allowed_url(URL const& url)
void ConnectionFromClient::add_allowed_url(URL const& url)
{
if (m_allowlist_is_sealed) {
did_misbehave("Got request to add more allowed handlers after list was sealed");
@ -76,7 +76,7 @@ void ClientConnection::add_allowed_url(URL const& url)
m_allowlist.empend(String(), false, Vector<URL> { url });
}
void ClientConnection::add_allowed_handler_with_any_url(String const& handler_name)
void ConnectionFromClient::add_allowed_handler_with_any_url(String const& handler_name)
{
if (m_allowlist_is_sealed) {
did_misbehave("Got request to add more allowed handlers after list was sealed");
@ -91,7 +91,7 @@ void ClientConnection::add_allowed_handler_with_any_url(String const& handler_na
m_allowlist.empend(handler_name, true, Vector<URL>());
}
void ClientConnection::add_allowed_handler_with_only_specific_urls(String const& handler_name, Vector<URL> const& urls)
void ConnectionFromClient::add_allowed_handler_with_only_specific_urls(String const& handler_name, Vector<URL> const& urls)
{
if (m_allowlist_is_sealed) {
did_misbehave("Got request to add more allowed handlers after list was sealed");
@ -111,7 +111,7 @@ void ClientConnection::add_allowed_handler_with_only_specific_urls(String const&
m_allowlist.empend(handler_name, false, urls);
}
void ClientConnection::seal_allowlist()
void ConnectionFromClient::seal_allowlist()
{
if (m_allowlist_is_sealed) {
did_misbehave("Got more than one request to seal the allowed handlers list");

View file

@ -8,19 +8,19 @@
#include <LaunchServer/LaunchClientEndpoint.h>
#include <LaunchServer/LaunchServerEndpoint.h>
#include <LibIPC/ClientConnection.h>
#include <LibIPC/ConnectionFromClient.h>
namespace LaunchServer {
class ClientConnection final : public IPC::ClientConnection<LaunchClientEndpoint, LaunchServerEndpoint> {
C_OBJECT(ClientConnection)
class ConnectionFromClient final : public IPC::ConnectionFromClient<LaunchClientEndpoint, LaunchServerEndpoint> {
C_OBJECT(ConnectionFromClient)
public:
~ClientConnection() override;
~ConnectionFromClient() override;
virtual void die() override;
private:
explicit ClientConnection(NonnullOwnPtr<Core::Stream::LocalSocket>, int client_id);
explicit ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSocket>, int client_id);
virtual Messages::LaunchServer::OpenUrlResponse open_url(URL const&, String const&) override;
virtual Messages::LaunchServer::GetHandlersForUrlResponse get_handlers_for_url(URL const&) override;

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "ClientConnection.h"
#include "ConnectionFromClient.h"
#include "Launcher.h"
#include <LibCore/ConfigFile.h>
#include <LibCore/EventLoop.h>
@ -15,7 +15,7 @@
ErrorOr<int> serenity_main(Main::Arguments)
{
Core::EventLoop event_loop;
auto server = TRY(IPC::MultiServer<LaunchServer::ClientConnection>::try_create());
auto server = TRY(IPC::MultiServer<LaunchServer::ConnectionFromClient>::try_create());
auto launcher = LaunchServer::Launcher();
launcher.load_handlers();