diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2023-05-26 19:48:45 +0200 |
---|---|---|
committer | Jelle Raaijmakers <jelle@gmta.nl> | 2023-05-29 13:17:22 +0200 |
commit | 8df7b4207888fcba94bfbc4a62c38442dcebb7bd (patch) | |
tree | a57c4eb110d6f33f1a942596862379c7f6d5bc08 /Userland/Libraries/LibFileSystemAccessClient | |
parent | 5857f24bc8dba4e3decf017bea9a9040f3570081 (diff) | |
download | serenity-8df7b4207888fcba94bfbc4a62c38442dcebb7bd.zip |
FileSystemAccessServer: Don't transmit unused data
The server cannot use these values anywhere, because this method always
sets 'prompt = ShouldPrompt::No'. This saves a bunch of roundtrips for
all clients that use FSAS to read abritrary files.
Diffstat (limited to 'Userland/Libraries/LibFileSystemAccessClient')
-rw-r--r-- | Userland/Libraries/LibFileSystemAccessClient/Client.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/Userland/Libraries/LibFileSystemAccessClient/Client.cpp b/Userland/Libraries/LibFileSystemAccessClient/Client.cpp index 4ddf2aa2f2..5987e4f8f2 100644 --- a/Userland/Libraries/LibFileSystemAccessClient/Client.cpp +++ b/Userland/Libraries/LibFileSystemAccessClient/Client.cpp @@ -28,21 +28,11 @@ Result Client::request_file_read_only_approved(GUI::Window* parent_window, Depre auto const id = get_new_id(); m_promises.set(id, RequestData { { Core::Promise<Result>::construct() }, parent_window, Core::File::OpenMode::Read }); - auto parent_window_server_client_id = GUI::ConnectionToWindowServer::the().expose_client_id(); - auto child_window_server_client_id = expose_window_server_client_id(); - auto parent_window_id = parent_window->window_id(); - - GUI::ConnectionToWindowServer::the().add_window_stealing_for_client(child_window_server_client_id, parent_window_id); - - ScopeGuard guard([parent_window_id, child_window_server_client_id] { - GUI::ConnectionToWindowServer::the().remove_window_stealing_for_client(child_window_server_client_id, parent_window_id); - }); - if (path.starts_with('/')) { - async_request_file_read_only_approved(id, parent_window_server_client_id, parent_window_id, path); + async_request_file_read_only_approved(id, path); } else { auto full_path = LexicalPath::join(TRY(FileSystem::current_working_directory()), path).string(); - async_request_file_read_only_approved(id, parent_window_server_client_id, parent_window_id, full_path); + async_request_file_read_only_approved(id, full_path); } return handle_promise(id); |