1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:27:45 +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(FileSystemAccessServer.ipc FileSystemAccessServerEndpoint.h)
compile_ipc(FileSystemAccessClient.ipc FileSystemAccessClientEndpoint.h)
set(SOURCES
ClientConnection.cpp
ConnectionFromClient.cpp
main.cpp
FileSystemAccessServerEndpoint.h
FileSystemAccessClientEndpoint.h

View file

@ -9,7 +9,7 @@
#include <LibGUI/WindowServerConnection.h>
// clang-format on
#include <AK/Debug.h>
#include <FileSystemAccessServer/ClientConnection.h>
#include <FileSystemAccessServer/ConnectionFromClient.h>
#include <LibCore/File.h>
#include <LibCore/IODevice.h>
#include <LibGUI/Application.h>
@ -18,25 +18,25 @@
namespace FileSystemAccessServer {
static HashMap<int, NonnullRefPtr<ClientConnection>> s_connections;
static HashMap<int, NonnullRefPtr<ConnectionFromClient>> s_connections;
ClientConnection::ClientConnection(NonnullOwnPtr<Core::Stream::LocalSocket> socket)
: IPC::ClientConnection<FileSystemAccessClientEndpoint, FileSystemAccessServerEndpoint>(*this, move(socket), 1)
ConnectionFromClient::ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSocket> socket)
: IPC::ConnectionFromClient<FileSystemAccessClientEndpoint, FileSystemAccessServerEndpoint>(*this, move(socket), 1)
{
s_connections.set(1, *this);
}
ClientConnection::~ClientConnection()
ConnectionFromClient::~ConnectionFromClient()
{
}
void ClientConnection::die()
void ConnectionFromClient::die()
{
s_connections.remove(client_id());
GUI::Application::the()->quit();
}
RefPtr<GUI::Window> ClientConnection::create_dummy_child_window(i32 window_server_client_id, i32 parent_window_id)
RefPtr<GUI::Window> ConnectionFromClient::create_dummy_child_window(i32 window_server_client_id, i32 parent_window_id)
{
auto window = GUI::Window::construct();
window->set_opacity(0);
@ -49,7 +49,7 @@ RefPtr<GUI::Window> ClientConnection::create_dummy_child_window(i32 window_serve
return window;
}
void ClientConnection::request_file_handler(i32 window_server_client_id, i32 parent_window_id, String const& path, Core::OpenMode const& requested_access, ShouldPrompt prompt)
void ConnectionFromClient::request_file_handler(i32 window_server_client_id, i32 parent_window_id, String const& path, Core::OpenMode const& requested_access, ShouldPrompt prompt)
{
VERIFY(path.starts_with("/"sv));
@ -110,17 +110,17 @@ void ClientConnection::request_file_handler(i32 window_server_client_id, i32 par
}
}
void ClientConnection::request_file_read_only_approved(i32 window_server_client_id, i32 parent_window_id, String const& path)
void ConnectionFromClient::request_file_read_only_approved(i32 window_server_client_id, i32 parent_window_id, String const& path)
{
request_file_handler(window_server_client_id, parent_window_id, path, Core::OpenMode::ReadOnly, ShouldPrompt::No);
}
void ClientConnection::request_file(i32 window_server_client_id, i32 parent_window_id, String const& path, Core::OpenMode const& requested_access)
void ConnectionFromClient::request_file(i32 window_server_client_id, i32 parent_window_id, String const& path, Core::OpenMode const& requested_access)
{
request_file_handler(window_server_client_id, parent_window_id, path, requested_access, ShouldPrompt::Yes);
}
void ClientConnection::prompt_open_file(i32 window_server_client_id, i32 parent_window_id, String const& window_title, String const& path_to_view, Core::OpenMode const& requested_access)
void ConnectionFromClient::prompt_open_file(i32 window_server_client_id, i32 parent_window_id, String const& window_title, String const& path_to_view, Core::OpenMode const& requested_access)
{
auto relevant_permissions = requested_access & (Core::OpenMode::ReadOnly | Core::OpenMode::WriteOnly);
VERIFY(relevant_permissions != Core::OpenMode::NotOpen);
@ -132,7 +132,7 @@ void ClientConnection::prompt_open_file(i32 window_server_client_id, i32 parent_
prompt_helper(user_picked_file, requested_access);
}
void ClientConnection::prompt_save_file(i32 window_server_client_id, i32 parent_window_id, String const& name, String const& ext, String const& path_to_view, Core::OpenMode const& requested_access)
void ConnectionFromClient::prompt_save_file(i32 window_server_client_id, i32 parent_window_id, String const& name, String const& ext, String const& path_to_view, Core::OpenMode const& requested_access)
{
auto relevant_permissions = requested_access & (Core::OpenMode::ReadOnly | Core::OpenMode::WriteOnly);
VERIFY(relevant_permissions != Core::OpenMode::NotOpen);
@ -144,7 +144,7 @@ void ClientConnection::prompt_save_file(i32 window_server_client_id, i32 parent_
prompt_helper(user_picked_file, requested_access);
}
void ClientConnection::prompt_helper(Optional<String> const& user_picked_file, Core::OpenMode const& requested_access)
void ConnectionFromClient::prompt_helper(Optional<String> const& user_picked_file, Core::OpenMode const& requested_access)
{
if (user_picked_file.has_value()) {
VERIFY(user_picked_file->starts_with("/"sv));
@ -169,7 +169,7 @@ void ClientConnection::prompt_helper(Optional<String> const& user_picked_file, C
}
}
Messages::FileSystemAccessServer::ExposeWindowServerClientIdResponse ClientConnection::expose_window_server_client_id()
Messages::FileSystemAccessServer::ExposeWindowServerClientIdResponse ConnectionFromClient::expose_window_server_client_id()
{
return GUI::WindowServerConnection::the().expose_client_id();
}

View file

@ -11,21 +11,21 @@
#include <FileSystemAccessServer/FileSystemAccessServerEndpoint.h>
#include <LibCore/Forward.h>
#include <LibGUI/Forward.h>
#include <LibIPC/ClientConnection.h>
#include <LibIPC/ConnectionFromClient.h>
namespace FileSystemAccessServer {
class ClientConnection final
: public IPC::ClientConnection<FileSystemAccessClientEndpoint, FileSystemAccessServerEndpoint> {
C_OBJECT(ClientConnection);
class ConnectionFromClient final
: public IPC::ConnectionFromClient<FileSystemAccessClientEndpoint, FileSystemAccessServerEndpoint> {
C_OBJECT(ConnectionFromClient);
public:
~ClientConnection() override;
~ConnectionFromClient() override;
virtual void die() override;
private:
explicit ClientConnection(NonnullOwnPtr<Core::Stream::LocalSocket>);
explicit ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSocket>);
virtual void request_file_read_only_approved(i32, i32, String const&) override;
virtual void request_file(i32, i32, String const&, Core::OpenMode const&) override;

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <FileSystemAccessServer/ClientConnection.h>
#include <FileSystemAccessServer/ConnectionFromClient.h>
#include <LibCore/System.h>
#include <LibGUI/Application.h>
#include <LibIPC/SingleServer.h>
@ -17,6 +17,6 @@ ErrorOr<int> serenity_main(Main::Arguments)
auto app = GUI::Application::construct(0, nullptr);
app->set_quit_when_last_window_deleted(false);
auto client = TRY(IPC::take_over_accepted_client_from_system_server<FileSystemAccessServer::ClientConnection>());
auto client = TRY(IPC::take_over_accepted_client_from_system_server<FileSystemAccessServer::ConnectionFromClient>());
return app->exec();
}