BrowserConnection.cpp 755 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Copyright (c) 2022, Florent Castelli <florent.castelli@gmail.com>
  3. * Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #include "BrowserConnection.h"
  8. #include "Client.h"
  9. namespace WebDriver {
  10. BrowserConnection::BrowserConnection(NonnullOwnPtr<Core::Stream::LocalSocket> socket, NonnullRefPtr<Client> client, unsigned session_id)
  11. : IPC::ConnectionFromClient<WebDriverSessionClientEndpoint, WebDriverSessionServerEndpoint>(*this, move(socket), 1)
  12. , m_client(move(client))
  13. , m_session_id(session_id)
  14. {
  15. }
  16. void BrowserConnection::die()
  17. {
  18. dbgln_if(WEBDRIVER_DEBUG, "Session {} was closed remotely. Shutting down...", m_session_id);
  19. m_client->close_session(m_session_id);
  20. }
  21. }