2022-11-08 10:18:11 -05:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022, Tim Flynn <trflynn89@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
2022-11-14 11:00:31 -05:00
|
|
|
#include <WebDriver/Client.h>
|
|
|
|
#include <WebDriver/WebContentConnection.h>
|
2022-11-08 10:18:11 -05:00
|
|
|
|
|
|
|
namespace WebDriver {
|
|
|
|
|
2023-02-08 23:05:44 +01:00
|
|
|
WebContentConnection::WebContentConnection(NonnullOwnPtr<Core::LocalSocket> socket, NonnullRefPtr<Client> client, unsigned session_id)
|
2022-11-08 10:18:11 -05:00
|
|
|
: IPC::ConnectionFromClient<WebDriverClientEndpoint, WebDriverServerEndpoint>(*this, move(socket), 1)
|
|
|
|
, m_client(move(client))
|
|
|
|
, m_session_id(session_id)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void WebContentConnection::die()
|
|
|
|
{
|
|
|
|
dbgln_if(WEBDRIVER_DEBUG, "Session {} was closed remotely. Shutting down...", m_session_id);
|
|
|
|
m_client->close_session(m_session_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|