mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-24 08:59:50 +00:00
WebDriver: Stop using the ancient Core::EventReceiver parent/child API
Before this change, clients were kept alive by making them children of the TCPServer object. This ownership model is going away (and this was the only remaining use of it!) so let's just put the clients in a hash table instead.
This commit is contained in:
parent
045eaa1576
commit
dfe776b722
Notes:
github-actions[bot]
2025-08-11 14:57:31 +00:00
Author: https://github.com/awesomekling
Commit: dfe776b722
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5817
Reviewed-by: https://github.com/gmta ✅
5 changed files with 24 additions and 12 deletions
|
|
@ -21,17 +21,17 @@
|
|||
|
||||
namespace WebDriver {
|
||||
|
||||
ErrorOr<NonnullRefPtr<Client>> Client::try_create(NonnullOwnPtr<Core::BufferedTCPSocket> socket, LaunchBrowserCallback launch_browser_callback, Core::EventReceiver* parent)
|
||||
ErrorOr<NonnullRefPtr<Client>> Client::try_create(NonnullOwnPtr<Core::BufferedTCPSocket> socket, LaunchBrowserCallback launch_browser_callback)
|
||||
{
|
||||
if (!launch_browser_callback)
|
||||
return Error::from_string_literal("The callback to launch the browser must be provided");
|
||||
|
||||
TRY(socket->set_blocking(true));
|
||||
return adopt_nonnull_ref_or_enomem(new (nothrow) Client(move(socket), move(launch_browser_callback), parent));
|
||||
return adopt_nonnull_ref_or_enomem(new (nothrow) Client(move(socket), move(launch_browser_callback)));
|
||||
}
|
||||
|
||||
Client::Client(NonnullOwnPtr<Core::BufferedTCPSocket> socket, LaunchBrowserCallback launch_browser_callback, Core::EventReceiver* parent)
|
||||
: Web::WebDriver::Client(move(socket), parent)
|
||||
Client::Client(NonnullOwnPtr<Core::BufferedTCPSocket> socket, LaunchBrowserCallback launch_browser_callback)
|
||||
: Web::WebDriver::Client(move(socket))
|
||||
, m_launch_browser_callback(move(launch_browser_callback))
|
||||
{
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue