Ladybird: Use MachPortServer to get WebContent Mach ports on macOS

This commit is contained in:
Andrew Kaster 2024-04-04 14:13:14 -06:00 committed by Andrew Kaster
commit 3b5ac433ef
Notes: sideshowbarker 2024-07-18 03:20:18 +09:00
7 changed files with 58 additions and 4 deletions

View file

@ -80,6 +80,12 @@ void ProcessManager::initialize()
MUST(Core::System::sigaction(SIGCHLD, &action, nullptr));
the().add_process(WebView::ProcessType::Chrome, getpid());
#ifdef AK_OS_MACH
auto self_send_port = mach_task_self();
auto res = mach_port_mod_refs(mach_task_self(), self_send_port, MACH_PORT_RIGHT_SEND, +1);
VERIFY(res == KERN_SUCCESS);
the().add_process(getpid(), Core::MachPort::adopt_right(self_send_port, Core::MachPort::PortRight::Send));
#endif
}
void ProcessManager::add_process(ProcessType type, pid_t pid)