Serenity Operating System
1/*
2 * Copyright (c) 2022, Tim Flynn <trflynn89@serenityos.org>
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7#include <WebDriver/Client.h>
8#include <WebDriver/WebContentConnection.h>
9
10namespace WebDriver {
11
12WebContentConnection::WebContentConnection(NonnullOwnPtr<Core::LocalSocket> socket, NonnullRefPtr<Client> client, unsigned session_id)
13 : IPC::ConnectionFromClient<WebDriverClientEndpoint, WebDriverServerEndpoint>(*this, move(socket), 1)
14 , m_client(move(client))
15 , m_session_id(session_id)
16{
17}
18
19void WebContentConnection::die()
20{
21 dbgln_if(WEBDRIVER_DEBUG, "Session {} was closed remotely. Shutting down...", m_session_id);
22 m_client->close_session(m_session_id);
23}
24
25}