summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibFileSystemAccessClient/Client.h
AgeCommit message (Collapse)Author
2022-10-03SystemServer+LoginServer+Userland: Switch to sid-based socketsPeter Elliott
This commit does three things atomically: - switch over Core::Account+SystemServer+LoginServer to sid based socket names. - change socket names with %uid to %sid. - add/update necessary pledges and unveils. Userland: Switch over servers to sid based sockets Userland: Properly pledge and unveil for sid based sockets
2022-08-14Base: Launch FileSystemAccessServer at session start-upLucas CHOLLET
2022-08-14LibCore+LibIPC: Recognise %uid in pathLucas CHOLLET
This patch allows to insert "%uid" in `IPC_CLIENT_CONNECTION` declaration and in SystemServer's ini files. This pattern is replaced then replaced by the UID of the owner of the service. It opens a path for seamlessly managed, per-user portal.
2022-06-27FileSystemAccessServer: Manage concurrent file requestsLucas CHOLLET
Before this patch, when you called FileSystemAccessServer::Client::try_* twice, the second call used the same variable to store the promise. This "race condition" is now solved using a HashMap, to store multiple parallel requests.
2022-02-25Userland: Rename IPC::ServerConnection=>IPC::ConnectionToServerItamar
This was done with CLion's automatic rename feature.
2022-01-20FileSystemAccessClient: Remove old API returning file descriptors :^)Mustafa Quraish
Since all users of the old API are now removed, this commit removes all the methods that returned raw file descriptors, in favor of returning `ErrorOr<NonnullRefPtr<Core::File>`.
2022-01-20FileSystemAccessClient: Add `try_*` variants returning `Core::File`Mustafa Quraish
The current implementation is a bit of a hack since we also want to keep around the previous variants for now, but will be cleaned up later once all applications have been ported to the new API.
2022-01-15LibCore+LibIPC+Everywhere: Return Stream::LocalSocket from LocalServersin-ack
This change unfortunately cannot be atomically made without a single commit changing everything. Most of the important changes are in LibIPC/Connection.cpp, LibIPC/ServerConnection.cpp and LibCore/LocalServer.cpp. The notable changes are: - IPCCompiler now generates the decode and decode_message functions such that they take a Core::Stream::LocalSocket instead of the socket fd. - IPC::Decoder now uses the receive_fd method of LocalSocket instead of doing system calls directly on the fd. - IPC::ConnectionBase and related classes now use the Stream API functions. - IPC::ServerConnection no longer constructs the socket itself; instead, a convenience macro, IPC_CLIENT_CONNECTION, is used in place of C_OBJECT and will generate a static try_create factory function for the ServerConnection subclass. The subclass is now responsible for passing the socket constructed in this function to its ServerConnection base; the socket is passed as the first argument to the constructor (as a NonnullOwnPtr<Core::Stream::LocalServer>) before any other arguments. - The functionality regarding taking over sockets from SystemServer has been moved to LibIPC/SystemServerTakeover.cpp. The Core::LocalSocket implementation of this functionality hasn't been deleted due to my intention of removing this class in the near future and to reduce noise on this (already quite noisy) PR.
2021-12-23LibFileSystemAccessClient: Allow custom access rights for open/saveArne Elster
There can be cases when one wants to open a file not just for reading but also for writing. It was already possible to have a custom open mode for request_file, now it is also possible through the open/save dialogs.
2021-11-11Everywhere: Pass AK::StringView by valueAndreas Kling
2021-09-10FileSystemAccessServer: Allow read-only access without promptingMustafa Quraish
This commit adds a new request to the FileSystemAccessServer endpoint, allowing the clients to get read-only access to a file without getting a Dialog-box prompting the user for access. This is only meant to be used in cases where the user has asked specifically to open a file through the command-line arguments. In those cases, I believe it makes sense for the read-only access to be implicit. Always prompting the user gets a bit annoying, especially if you just quickly want to open a file through the CLI. The new request name has been made extremely specific to make sure that it's only used when appropriate.
2021-08-07FileSystemAccessServer: Add window title as parameter for opening fileTimothy
2021-07-18FileSystemAccessServer+TextEditor: Implement cross-process modal promptsTimothy
This transitions from synchronous IPC calls to asynchronous IPC calls provided through a synchronous interface in LibFileSystemAccessClient which allows the parent Application to stay responsive. It achieves this with Promise which is pumping the Application event loop while waiting for the Dialog to respond with the user's action. LibFileSystemAccessClient provides a lazy singleton which also ensures that FileSystemAccessServer is running in the event of a crash. This also transitions TextEditor into using LibFileSystemAccessClient.