LibWebView: Port to Windows

This commit is contained in:
stasoid 2024-12-21 16:19:39 +05:00
parent 34f78ca152
commit 4f9cce4081
2 changed files with 3 additions and 4 deletions

View file

@ -57,9 +57,11 @@ Application::~Application()
void Application::initialize(Main::Arguments const& arguments, URL::URL new_tab_page_url)
{
#ifndef AK_OS_WINDOWS
// Increase the open file limit, as the default limits on Linux cause us to run out of file descriptors with around 15 tabs open.
if (auto result = Core::System::set_resource_limits(RLIMIT_NOFILE, 8192); result.is_error())
warnln("Unable to increase open file limit: {}", result.error());
#endif
Vector<ByteString> raw_urls;
Vector<ByteString> certificates;

View file

@ -40,7 +40,7 @@ ErrorOr<ChromeProcess::ProcessDisposition> ChromeProcess::connect(Vector<ByteStr
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;
}
@ -48,7 +48,6 @@ ErrorOr<ChromeProcess::ProcessDisposition> ChromeProcess::connect(Vector<ByteStr
ErrorOr<void> ChromeProcess::connect_as_client(ByteString const& socket_path, Vector<ByteString> const& raw_urls, NewWindow new_window)
{
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 +63,6 @@ ErrorOr<void> ChromeProcess::connect_as_client(ByteString const& socket_path, Ve
ErrorOr<void> ChromeProcess::connect_as_server(ByteString const& socket_path)
{
static_assert(IsSame<IPC::Transport, IPC::TransportSocket>, "Need to handle other IPC transports here");
auto socket_fd = TRY(Process::create_ipc_socket(socket_path));
m_socket_path = socket_path;
auto local_server = TRY(Core::LocalServer::try_create());