mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibCore/Process: Make all spawn
overloads return ErrorOr<Process>
This commit is contained in:
parent
ddd15e96b6
commit
4a731b3858
Notes:
github-actions[bot]
2024-11-19 22:28:35 +00:00
Author: https://github.com/stasoid
Commit: 4a731b3858
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2377
Reviewed-by: https://github.com/ADKaster ✅
6 changed files with 22 additions and 27 deletions
|
@ -43,10 +43,9 @@ Session::~Session()
|
|||
// from active sessions
|
||||
|
||||
// 3. Perform any implementation-specific cleanup steps.
|
||||
if (m_browser_pid.has_value()) {
|
||||
MUST(Core::System::kill(*m_browser_pid, SIGTERM));
|
||||
m_browser_pid = {};
|
||||
}
|
||||
if (m_browser_process.has_value())
|
||||
MUST(Core::System::kill(m_browser_process->pid(), SIGTERM));
|
||||
|
||||
if (m_web_content_socket_path.has_value()) {
|
||||
MUST(Core::System::unlink(*m_web_content_socket_path));
|
||||
m_web_content_socket_path = {};
|
||||
|
@ -172,9 +171,9 @@ ErrorOr<void> Session::start(LaunchBrowserCallbacks const& callbacks)
|
|||
m_web_content_server = TRY(create_server(promise));
|
||||
|
||||
if (m_options.headless)
|
||||
m_browser_pid = TRY(callbacks.launch_headless_browser(*m_web_content_socket_path));
|
||||
m_browser_process = TRY(callbacks.launch_headless_browser(*m_web_content_socket_path));
|
||||
else
|
||||
m_browser_pid = TRY(callbacks.launch_browser(*m_web_content_socket_path));
|
||||
m_browser_process = TRY(callbacks.launch_browser(*m_web_content_socket_path));
|
||||
|
||||
// FIXME: Allow this to be more asynchronous. For now, this at least allows us to propagate
|
||||
// errors received while accepting the Browser and WebContent sockets.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue