diff --git a/Userland/Services/WebContent/ClientConnection.cpp b/Userland/Services/WebContent/ClientConnection.cpp index 982e54700a..7729c8b6dd 100644 --- a/Userland/Services/WebContent/ClientConnection.cpp +++ b/Userland/Services/WebContent/ClientConnection.cpp @@ -29,13 +29,10 @@ namespace WebContent { -static HashMap> s_connections; - -ClientConnection::ClientConnection(NonnullRefPtr socket, int client_id) - : IPC::ClientConnection(*this, move(socket), client_id) +ClientConnection::ClientConnection(NonnullRefPtr socket) + : IPC::ClientConnection(*this, move(socket), 1) , m_page_host(PageHost::create(*this)) { - s_connections.set(client_id, *this); m_paint_flush_timer = Core::Timer::create_single_shot(0, [this] { flush_pending_paint_requests(); }); } @@ -45,9 +42,7 @@ ClientConnection::~ClientConnection() void ClientConnection::die() { - s_connections.remove(client_id()); - if (s_connections.is_empty()) - Core::EventLoop::current().quit(0); + Core::EventLoop::current().quit(0); } Web::Page& ClientConnection::page() diff --git a/Userland/Services/WebContent/ClientConnection.h b/Userland/Services/WebContent/ClientConnection.h index 2fdbc7d7b2..ef53ee2249 100644 --- a/Userland/Services/WebContent/ClientConnection.h +++ b/Userland/Services/WebContent/ClientConnection.h @@ -32,7 +32,7 @@ public: void initialize_js_console(Badge); private: - explicit ClientConnection(NonnullRefPtr, int client_id); + explicit ClientConnection(NonnullRefPtr); Web::Page& page(); const Web::Page& page() const; diff --git a/Userland/Services/WebContent/main.cpp b/Userland/Services/WebContent/main.cpp index ac08ecbe93..275c22697f 100644 --- a/Userland/Services/WebContent/main.cpp +++ b/Userland/Services/WebContent/main.cpp @@ -22,6 +22,6 @@ ErrorOr serenity_main(Main::Arguments) TRY(Core::System::unveil(nullptr, nullptr)); auto socket = TRY(Core::LocalSocket::take_over_accepted_socket_from_system_server()); - IPC::new_client_connection(move(socket), 1); + auto client = IPC::new_client_connection(move(socket)); return event_loop.exec(); }