Everywhere: Hand pid of new process to client in launch_server_process()

Allows WebContentClient to get pid of WebContent process right after
creation, so there is no window between forking and
notify_process_information() IPC response, when client doesn't know the
pid.
This commit is contained in:
Aliaksandr Kalenik
2024-06-18 19:11:51 +03:00
committed by Andreas Kling
parent 3110411c60
commit c46bea479c
5 changed files with 5 additions and 11 deletions

View File

@@ -48,6 +48,9 @@ static ErrorOr<NonnullRefPtr<ClientType>> launch_server_process(
if (!result.is_error()) {
auto process = result.release_value();
if constexpr (requires { process.client->set_pid(pid_t {}); })
process.client->set_pid(process.process.pid());
if (register_with_process_manager == RegisterWithProcessManager::Yes)
WebView::ProcessManager::the().add_process(WebView::process_type_from_name(server_name), process.process.pid());