diff options
author | Andreas Kling <kling@serenityos.org> | 2023-04-24 07:45:36 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-04-25 14:48:40 +0200 |
commit | a6a2caf6db1cd3e055dcec167d2d016ea54f655d (patch) | |
tree | c0826ed375c84ba2ce1d7d39c0e773e6aff59217 /Userland/Libraries/LibCore | |
parent | 8e7d7b0ec26ed0004df6ca08ecd9d5f298f5c108 (diff) | |
download | serenity-a6a2caf6db1cd3e055dcec167d2d016ea54f655d.zip |
LibCore: Remove unused "client ID" from InspectorServerConnection
This was sharing an ID allocator with event loop timers for some reason.
More importantly, it wasn't actually used for anything.
Diffstat (limited to 'Userland/Libraries/LibCore')
-rw-r--r-- | Userland/Libraries/LibCore/EventLoop.cpp | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/Userland/Libraries/LibCore/EventLoop.cpp b/Userland/Libraries/LibCore/EventLoop.cpp index 98a4e6ab02..d6a8d77393 100644 --- a/Userland/Libraries/LibCore/EventLoop.cpp +++ b/Userland/Libraries/LibCore/EventLoop.cpp @@ -168,9 +168,6 @@ class InspectorServerConnection : public Object { private: explicit InspectorServerConnection(NonnullOwnPtr<LocalSocket> socket) : m_socket(move(socket)) - , m_client_id(s_id_allocator.with_locked([](auto& allocator) { - return allocator->allocate(); - })) { #ifdef AK_OS_SERENITY m_socket->on_ready_to_read = [this] { @@ -178,14 +175,12 @@ private: auto maybe_bytes_read = m_socket->read_some({ (u8*)&length, sizeof(length) }); if (maybe_bytes_read.is_error()) { dbgln("InspectorServerConnection: Failed to read message length from inspector server connection: {}", maybe_bytes_read.error()); - shutdown(); return; } auto bytes_read = maybe_bytes_read.release_value(); if (bytes_read.is_empty()) { dbgln_if(EVENTLOOP_DEBUG, "RPC client disconnected"); - shutdown(); return; } @@ -195,7 +190,6 @@ private: maybe_bytes_read = m_socket->read_some(request_buffer.bytes()); if (maybe_bytes_read.is_error()) { dbgln("InspectorServerConnection: Failed to read message content from inspector server connection: {}", maybe_bytes_read.error()); - shutdown(); return; } @@ -204,7 +198,6 @@ private: auto request_json = JsonValue::from_string(request_buffer); if (request_json.is_error() || !request_json.value().is_object()) { dbgln("RPC client sent invalid request"); - shutdown(); return; } @@ -301,22 +294,11 @@ public: } return; } - - if (type == "Disconnect") { - shutdown(); - return; - } - } - - void shutdown() - { - s_id_allocator.with_locked([this](auto& allocator) { allocator->deallocate(m_client_id); }); } private: NonnullOwnPtr<LocalSocket> m_socket; WeakPtr<Object> m_inspected_object; - int m_client_id { -1 }; }; EventLoop::EventLoop([[maybe_unused]] MakeInspectable make_inspectable) |