ladybird/Userland/Services/LaunchServer/ConnectionFromClient.h
Shannon Booth e800605ad3 AK+LibURL: Move AK::URL into a new URL library
This URL library ends up being a relatively fundamental base library of
the system, as LibCore depends on LibURL.

This change has two main benefits:
 * Moving AK back more towards being an agnostic library that can
   be used between the kernel and userspace. URL has never really fit
   that description - and is not used in the kernel.
 * URL _should_ depend on LibUnicode, as it needs punnycode support.
   However, it's not really possible to do this inside of AK as it can't
   depend on any external library. This change brings us a little closer
   to being able to do that, but unfortunately we aren't there quite
   yet, as the code generators depend on LibCore.
2024-03-18 14:06:28 -04:00

42 lines
1.5 KiB
C++

/*
* Copyright (c) 2020, Nicholas Hollett <niax@niax.co.uk>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LaunchServer/LaunchClientEndpoint.h>
#include <LaunchServer/LaunchServerEndpoint.h>
#include <LibIPC/ConnectionFromClient.h>
namespace LaunchServer {
class ConnectionFromClient final : public IPC::ConnectionFromClient<LaunchClientEndpoint, LaunchServerEndpoint> {
C_OBJECT(ConnectionFromClient)
public:
~ConnectionFromClient() override = default;
virtual void die() override;
private:
explicit ConnectionFromClient(NonnullOwnPtr<Core::LocalSocket>, int client_id);
virtual Messages::LaunchServer::OpenUrlResponse open_url(URL::URL const&, ByteString const&) override;
virtual Messages::LaunchServer::GetHandlersForUrlResponse get_handlers_for_url(URL::URL const&) override;
virtual Messages::LaunchServer::GetHandlersWithDetailsForUrlResponse get_handlers_with_details_for_url(URL::URL const&) override;
virtual void add_allowed_url(URL::URL const&) override;
virtual void add_allowed_handler_with_any_url(ByteString const&) override;
virtual void add_allowed_handler_with_only_specific_urls(ByteString const&, Vector<URL::URL> const&) override;
virtual void seal_allowlist() override;
struct AllowlistEntry {
ByteString handler_name;
bool any_url { false };
Vector<URL::URL> urls;
};
Vector<AllowlistEntry> m_allowlist;
bool m_allowlist_is_sealed { false };
};
}