LibWebView: Port to Windows

This commit is contained in:
stasoid 2024-12-21 16:19:39 +05:00 committed by Andrew Kaster
parent 2abc792938
commit 2dd657f530
Notes: github-actions[bot] 2025-03-20 02:26:23 +00:00
5 changed files with 33 additions and 13 deletions

View file

@ -50,6 +50,8 @@ StringView process_name_from_type(ProcessType type)
ProcessManager::ProcessManager()
: on_process_exited([](Process&&) { })
{
// FIXME: Handle exiting child processes on Windows
#ifndef AK_OS_WINDOWS
m_signal_handle = Core::EventLoop::register_signal(SIGCHLD, [this](int) {
auto result = Core::System::waitpid(-1, WNOHANG);
while (!result.is_error() && result.value().pid > 0) {
@ -61,6 +63,7 @@ ProcessManager::ProcessManager()
result = Core::System::waitpid(-1, WNOHANG);
}
});
#endif
add_process(Process(WebView::ProcessType::Browser, nullptr, Core::Process::current()));
@ -74,7 +77,10 @@ ProcessManager::ProcessManager()
ProcessManager::~ProcessManager()
{
// FIXME: Handle exiting child processes on Windows
#ifndef AK_OS_WINDOWS
Core::EventLoop::unregister_signal(m_signal_handle);
#endif
}
Optional<Process&> ProcessManager::find_process(pid_t pid)