1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 20:07:36 +00:00

FileSystemAccessServer: Manage concurrent file requests

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.
This commit is contained in:
Lucas CHOLLET 2022-02-26 17:24:22 +01:00 committed by Linus Groh
parent e432a284d7
commit 9521952f36
6 changed files with 88 additions and 61 deletions

View file

@ -3,10 +3,10 @@
endpoint FileSystemAccessServer
{
request_file_read_only_approved(i32 window_server_client_id, i32 window_id, String path) =|
request_file(i32 window_server_client_id, i32 window_id, String path, Core::OpenMode requested_access) =|
prompt_open_file(i32 window_server_client_id, i32 window_id, String window_title, String path_to_view, Core::OpenMode requested_access) =|
prompt_save_file(i32 window_server_client_id, i32 window_id,String title, String ext, String path_to_view, Core::OpenMode requested_access) =|
request_file_read_only_approved(i32 request_id, i32 window_server_client_id, i32 window_id, String path) =|
request_file(i32 request_id, i32 window_server_client_id, i32 window_id, String path, Core::OpenMode requested_access) =|
prompt_open_file(i32 request_id, i32 window_server_client_id, i32 window_id, String window_title, String path_to_view, Core::OpenMode requested_access) =|
prompt_save_file(i32 request_id, i32 window_server_client_id, i32 window_id, String title, String ext, String path_to_view, Core::OpenMode requested_access) =|
expose_window_server_client_id() => (i32 client_id)
}