mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWebView: Implement stubbed out BrowserProcess methods on Windows
This commit is contained in:
Notes:
github-actions[bot]
2025-10-30 03:09:32 +00:00
Author: https://github.com/ayeteadoe Commit: https://github.com/LadybirdBrowser/ladybird/commit/6261c433a3d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5981 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/R-Goc Reviewed-by: https://github.com/sakgoyal Reviewed-by: https://github.com/stasoid
@@ -45,9 +45,8 @@ ErrorOr<BrowserProcess::ProcessDisposition> BrowserProcess::connect(Vector<ByteS
|
||||
return ProcessDisposition::ContinueMainProcess;
|
||||
}
|
||||
|
||||
ErrorOr<void> BrowserProcess::connect_as_client([[maybe_unused]] ByteString const& socket_path, [[maybe_unused]] Vector<ByteString> const& raw_urls, [[maybe_unused]] NewWindow new_window)
|
||||
ErrorOr<void> BrowserProcess::connect_as_client(ByteString const& socket_path, Vector<ByteString> const& raw_urls, NewWindow new_window)
|
||||
{
|
||||
#if !defined(AK_OS_WINDOWS)
|
||||
// TODO: Mach IPC
|
||||
auto socket = TRY(Core::LocalSocket::connect(socket_path));
|
||||
auto client = UIProcessClient::construct(make<IPC::Transport>(move(socket)));
|
||||
@@ -61,14 +60,10 @@ ErrorOr<void> BrowserProcess::connect_as_client([[maybe_unused]] ByteString cons
|
||||
}
|
||||
|
||||
return {};
|
||||
#else
|
||||
return Error::from_string_literal("BrowserProcess::connect_as_client() is not implemented on Windows");
|
||||
#endif
|
||||
}
|
||||
|
||||
ErrorOr<void> BrowserProcess::connect_as_server([[maybe_unused]] ByteString const& socket_path)
|
||||
ErrorOr<void> BrowserProcess::connect_as_server(ByteString const& socket_path)
|
||||
{
|
||||
#if !defined(AK_OS_WINDOWS)
|
||||
// TODO: Mach IPC
|
||||
auto socket_fd = TRY(Process::create_ipc_socket(socket_path));
|
||||
m_socket_path = socket_path;
|
||||
@@ -90,15 +85,18 @@ ErrorOr<void> BrowserProcess::connect_as_server([[maybe_unused]] ByteString cons
|
||||
};
|
||||
|
||||
return {};
|
||||
#else
|
||||
return Error::from_string_literal("BrowserProcess::connect_as_server() is not implemented on Windows");
|
||||
#endif
|
||||
}
|
||||
|
||||
BrowserProcess::~BrowserProcess()
|
||||
{
|
||||
if (m_pid_file) {
|
||||
MUST(m_pid_file->truncate(0));
|
||||
#if defined(AK_OS_WINDOWS)
|
||||
// NOTE: On Windows, System::open() duplicates the underlying OS file handle,
|
||||
// so we need to explicitly close said handle, otherwise the unlink() call fails due
|
||||
// to permission errors and we crash on shutdown.
|
||||
m_pid_file->close();
|
||||
#endif
|
||||
MUST(Core::System::unlink(m_pid_path));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user