mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWebView: Implement stubbed out BrowserProcess methods on Windows
This commit is contained in:
parent
231336f137
commit
6261c433a3
Notes:
github-actions[bot]
2025-10-30 03:09:32 +00:00
Author: https://github.com/ayeteadoe
Commit: 6261c433a3
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
1 changed files with 8 additions and 10 deletions
|
|
@ -45,9 +45,8 @@ ErrorOr<BrowserProcess::ProcessDisposition> BrowserProcess::connect(Vector<ByteS
|
||||||
return ProcessDisposition::ContinueMainProcess;
|
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
|
// TODO: Mach IPC
|
||||||
auto socket = TRY(Core::LocalSocket::connect(socket_path));
|
auto socket = TRY(Core::LocalSocket::connect(socket_path));
|
||||||
auto client = UIProcessClient::construct(make<IPC::Transport>(move(socket)));
|
auto client = UIProcessClient::construct(make<IPC::Transport>(move(socket)));
|
||||||
|
|
@ -61,14 +60,10 @@ ErrorOr<void> BrowserProcess::connect_as_client([[maybe_unused]] ByteString cons
|
||||||
}
|
}
|
||||||
|
|
||||||
return {};
|
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
|
// TODO: Mach IPC
|
||||||
auto socket_fd = TRY(Process::create_ipc_socket(socket_path));
|
auto socket_fd = TRY(Process::create_ipc_socket(socket_path));
|
||||||
m_socket_path = socket_path;
|
m_socket_path = socket_path;
|
||||||
|
|
@ -90,15 +85,18 @@ ErrorOr<void> BrowserProcess::connect_as_server([[maybe_unused]] ByteString cons
|
||||||
};
|
};
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
#else
|
|
||||||
return Error::from_string_literal("BrowserProcess::connect_as_server() is not implemented on Windows");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BrowserProcess::~BrowserProcess()
|
BrowserProcess::~BrowserProcess()
|
||||||
{
|
{
|
||||||
if (m_pid_file) {
|
if (m_pid_file) {
|
||||||
MUST(m_pid_file->truncate(0));
|
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));
|
MUST(Core::System::unlink(m_pid_path));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue