1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-08 05:27:14 +09:00

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

@ -40,15 +40,15 @@ ErrorOr<BrowserProcess::ProcessDisposition> BrowserProcess::connect(Vector<ByteS
m_pid_path = pid_path;
m_pid_file = TRY(Core::File::open(pid_path, Core::File::OpenMode::Write));
TRY(m_pid_file->write_until_depleted(ByteString::number(::getpid())));
TRY(m_pid_file->write_until_depleted(ByteString::number(Core::System::getpid())));
return ProcessDisposition::ContinueMainProcess;
}
ErrorOr<void> BrowserProcess::connect_as_client(ByteString const& socket_path, Vector<ByteString> const& raw_urls, NewWindow new_window)
{
// TODO: Mach IPC
auto socket = TRY(Core::LocalSocket::connect(socket_path));
static_assert(IsSame<IPC::Transport, IPC::TransportSocket>, "Need to handle other IPC transports here");
auto client = UIProcessClient::construct(IPC::Transport(move(socket)));
if (new_window == NewWindow::Yes) {
@ -64,8 +64,7 @@ ErrorOr<void> BrowserProcess::connect_as_client(ByteString const& socket_path, V
ErrorOr<void> BrowserProcess::connect_as_server(ByteString const& socket_path)
{
static_assert(IsSame<IPC::Transport, IPC::TransportSocket>, "Need to handle other IPC transports here");
// TODO: Mach IPC
auto socket_fd = TRY(Process::create_ipc_socket(socket_path));
m_socket_path = socket_path;
auto local_server = TRY(Core::LocalServer::try_create());