Просмотр исходного кода

Userland: Migrate to argument-less deferred_invoke

Only one place used this argument and it was to hold on to a strong ref
for the object. Since we already do that now, there's no need to keep
this argument around since this can be easily captured.

This commit contains no changes.
sin-ack 3 лет назад
Родитель
Сommit
8ea22121ac
32 измененных файлов с 72 добавлено и 75 удалено
  1. 2 2
      Userland/Applications/Browser/BrowserWindow.cpp
  2. 1 1
      Userland/Applications/FontEditor/FontEditor.cpp
  3. 2 2
      Userland/Applications/FontEditor/NewFontDialog.cpp
  4. 1 1
      Userland/Applications/Help/main.cpp
  5. 1 1
      Userland/Applications/PixelPaint/main.cpp
  6. 1 1
      Userland/Libraries/LibGUI/ComboBox.cpp
  7. 4 4
      Userland/Libraries/LibGUI/TabWidget.cpp
  8. 1 1
      Userland/Libraries/LibGUI/TextEditor.cpp
  9. 2 2
      Userland/Libraries/LibGUI/Window.cpp
  10. 1 1
      Userland/Libraries/LibGUI/WindowServerConnection.cpp
  11. 4 4
      Userland/Libraries/LibGemini/GeminiJob.cpp
  12. 9 9
      Userland/Libraries/LibGemini/Job.cpp
  13. 2 2
      Userland/Libraries/LibHTTP/HttpJob.cpp
  14. 4 4
      Userland/Libraries/LibHTTP/HttpsJob.cpp
  15. 10 10
      Userland/Libraries/LibHTTP/Job.cpp
  16. 2 2
      Userland/Libraries/LibIPC/Connection.h
  17. 4 4
      Userland/Libraries/LibLine/Editor.cpp
  18. 1 1
      Userland/Libraries/LibLine/InternalFunctions.cpp
  19. 1 1
      Userland/Libraries/LibTLS/Record.cpp
  20. 2 2
      Userland/Libraries/LibTLS/Socket.cpp
  21. 4 4
      Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp
  22. 1 1
      Userland/Libraries/LibWeb/OutOfProcessWebView.cpp
  23. 1 1
      Userland/Libraries/LibWebSocket/Impl/TCPWebSocketConnectionImpl.cpp
  24. 1 1
      Userland/Libraries/LibWebSocket/Impl/TLSv12WebSocketConnectionImpl.cpp
  25. 2 2
      Userland/Services/SQLServer/DatabaseConnection.cpp
  26. 2 2
      Userland/Services/SQLServer/SQLStatement.cpp
  27. 1 4
      Userland/Services/WebServer/Client.cpp
  28. 1 1
      Userland/Services/WebSocket/ClientConnection.cpp
  29. 1 1
      Userland/Services/WindowServer/ClientConnection.cpp
  30. 1 1
      Userland/Services/WindowServer/WMClientConnection.cpp
  31. 1 1
      Userland/Services/WindowServer/Window.cpp
  32. 1 1
      Userland/Shell/Shell.cpp

+ 2 - 2
Userland/Applications/Browser/BrowserWindow.cpp

@@ -434,7 +434,7 @@ void BrowserWindow::create_new_tab(URL url, bool activate)
     };
 
     new_tab.on_tab_close_request = [this](auto& tab) {
-        m_tab_widget->deferred_invoke([this, &tab](auto&) {
+        m_tab_widget->deferred_invoke([this, &tab] {
             m_tab_widget->remove_tab(tab);
             m_tab_widget->set_bar_visible(!is_fullscreen() && m_tab_widget->children().size() > 1);
             if (m_tab_widget->children().is_empty())
@@ -443,7 +443,7 @@ void BrowserWindow::create_new_tab(URL url, bool activate)
     };
 
     new_tab.on_tab_close_other_request = [this](auto& tab) {
-        m_tab_widget->deferred_invoke([this, &tab](auto&) {
+        m_tab_widget->deferred_invoke([this, &tab] {
             m_tab_widget->remove_all_tabs_except(tab);
             VERIFY(m_tab_widget->children().size() == 1);
             m_tab_widget->set_bar_visible(false);

+ 1 - 1
Userland/Applications/FontEditor/FontEditor.cpp

@@ -500,7 +500,7 @@ void FontEditorWidget::initialize(const String& path, RefPtr<Gfx::BitmapFont>&&
     m_fixed_width_checkbox->set_checked(m_edited_font->is_fixed_width());
 
     m_glyph_map_widget->set_selected_glyph('A');
-    deferred_invoke([this](auto&) {
+    deferred_invoke([this] {
         m_glyph_map_widget->set_focus(true);
         m_glyph_map_widget->scroll_to_glyph(m_glyph_map_widget->selected_glyph());
         window()->set_modified(false);

+ 2 - 2
Userland/Applications/FontEditor/NewFontDialog.cpp

@@ -196,7 +196,7 @@ NewFontDialog::NewFontDialog(GUI::Window* parent_window)
 
     m_glyph_width_spinbox->on_change = [&](int value) {
         preview_editor.set_preview_size(value, m_glyph_height_spinbox->value());
-        deferred_invoke([&](auto&) {
+        deferred_invoke([&] {
             m_glyph_editor_container->set_fixed_height(1 + preview_editor.height() + preview_editor.frame_thickness() * 2);
         });
     };
@@ -204,7 +204,7 @@ NewFontDialog::NewFontDialog(GUI::Window* parent_window)
         preview_editor.set_preview_size(m_glyph_width_spinbox->value(), value);
         m_mean_line_spinbox->set_max(max(value - 2, 0));
         m_baseline_spinbox->set_max(max(value - 2, 0));
-        deferred_invoke([&](auto&) {
+        deferred_invoke([&] {
             m_glyph_editor_container->set_fixed_height(1 + preview_editor.height() + preview_editor.frame_thickness() * 2);
         });
     };

+ 1 - 1
Userland/Applications/Help/main.cpp

@@ -154,7 +154,7 @@ int main(int argc, char* argv[])
         auto url = URL::create_with_file_protocol(path);
         page_view.load_html(html, url);
 
-        app->deferred_invoke([&, path](auto&) {
+        app->deferred_invoke([&, path] {
             auto tree_view_index = model->index_from_path(path);
             if (tree_view_index.has_value()) {
                 tree_view.expand_tree(tree_view_index.value().parent());

+ 1 - 1
Userland/Applications/PixelPaint/main.cpp

@@ -726,7 +726,7 @@ int main(int argc, char** argv)
             layer_properties_widget.set_layer(nullptr);
         }
 
-        tab_widget.deferred_invoke([&](auto&) {
+        tab_widget.deferred_invoke([&] {
             tab_widget.remove_tab(image_editor);
         });
     };

+ 1 - 1
Userland/Libraries/LibGUI/ComboBox.cpp

@@ -111,7 +111,7 @@ ComboBox::ComboBox()
     };
 
     m_list_view->on_activation = [this](auto& index) {
-        deferred_invoke([this, index](auto&) {
+        deferred_invoke([this, index] {
             selection_updated(index);
             if (on_change)
                 on_change(m_editor->text(), index);

+ 4 - 4
Userland/Libraries/LibGUI/TabWidget.cpp

@@ -105,7 +105,7 @@ void TabWidget::set_active_widget(Widget* widget)
         if (active_widget_had_focus)
             m_active_widget->set_focus(true);
         m_active_widget->set_visible(true);
-        deferred_invoke([this](auto&) {
+        deferred_invoke([this] {
             if (on_change)
                 on_change(*m_active_widget);
         });
@@ -396,7 +396,7 @@ void TabWidget::mousedown_event(MouseEvent& event)
             set_active_widget(m_tabs[i].widget);
         } else if (event.button() == MouseButton::Middle) {
             auto* widget = m_tabs[i].widget;
-            deferred_invoke([this, widget](auto&) {
+            deferred_invoke([this, widget] {
                 if (on_middle_click && widget)
                     on_middle_click(*widget);
             });
@@ -417,7 +417,7 @@ void TabWidget::mouseup_event(MouseEvent& event)
 
     if (close_button_rect.contains(event.position())) {
         auto* widget = m_tabs[m_pressed_close_button_index.value()].widget;
-        deferred_invoke([this, widget](auto&) {
+        deferred_invoke([this, widget] {
             if (on_tab_close_click && widget)
                 on_tab_close_click(*widget);
         });
@@ -573,7 +573,7 @@ void TabWidget::context_menu_event(ContextMenuEvent& context_menu_event)
         if (!button_rect.contains(context_menu_event.position()))
             continue;
         auto* widget = m_tabs[i].widget;
-        deferred_invoke([this, widget, context_menu_event](auto&) {
+        deferred_invoke([this, widget, context_menu_event] {
             if (on_context_menu_request && widget)
                 on_context_menu_request(*widget, context_menu_event);
         });

+ 1 - 1
Userland/Libraries/LibGUI/TextEditor.cpp

@@ -1469,7 +1469,7 @@ void TextEditor::did_change()
     m_needs_rehighlight = true;
     if (!m_has_pending_change_notification) {
         m_has_pending_change_notification = true;
-        deferred_invoke([this](auto&) {
+        deferred_invoke([this] {
             m_has_pending_change_notification = false;
             if (on_change)
                 on_change();

+ 2 - 2
Userland/Libraries/LibGUI/Window.cpp

@@ -694,7 +694,7 @@ void Window::update(const Gfx::IntRect& a_rect)
     }
 
     if (m_pending_paint_event_rects.is_empty()) {
-        deferred_invoke([this](auto&) {
+        deferred_invoke([this] {
             auto rects = move(m_pending_paint_event_rects);
             if (rects.is_empty())
                 return;
@@ -1029,7 +1029,7 @@ void Window::schedule_relayout()
     if (m_layout_pending)
         return;
     m_layout_pending = true;
-    deferred_invoke([this](auto&) {
+    deferred_invoke([this] {
         if (main_widget())
             main_widget()->do_layout();
         update();

+ 1 - 1
Userland/Libraries/LibGUI/WindowServerConnection.cpp

@@ -364,7 +364,7 @@ void WindowServerConnection::display_link_notification()
         return;
 
     m_display_link_notification_pending = true;
-    deferred_invoke([this](auto&) {
+    deferred_invoke([this] {
         DisplayLink::notify({});
         m_display_link_notification_pending = false;
     });

+ 4 - 4
Userland/Libraries/LibGemini/GeminiJob.cpp

@@ -25,15 +25,15 @@ void GeminiJob::start()
     };
     m_socket->on_tls_error = [this](TLS::AlertDescription error) {
         if (error == TLS::AlertDescription::HandshakeFailure) {
-            deferred_invoke([this](auto&) {
+            deferred_invoke([this] {
                 return did_fail(Core::NetworkJob::Error::ProtocolFailed);
             });
         } else if (error == TLS::AlertDescription::DecryptError) {
-            deferred_invoke([this](auto&) {
+            deferred_invoke([this] {
                 return did_fail(Core::NetworkJob::Error::ConnectionFailed);
             });
         } else {
-            deferred_invoke([this](auto&) {
+            deferred_invoke([this] {
                 return did_fail(Core::NetworkJob::Error::TransmissionFailed);
             });
         }
@@ -47,7 +47,7 @@ void GeminiJob::start()
     };
     bool success = ((TLS::TLSv12&)*m_socket).connect(m_request.url().host(), m_request.url().port());
     if (!success) {
-        deferred_invoke([this](auto&) {
+        deferred_invoke([this] {
             return did_fail(Core::NetworkJob::Error::ConnectionFailed);
         });
     }

+ 9 - 9
Userland/Libraries/LibGemini/Job.cpp

@@ -53,7 +53,7 @@ void Job::on_socket_connected()
         }
         bool success = write(raw_request);
         if (!success)
-            deferred_invoke([this](auto&) { did_fail(Core::NetworkJob::Error::TransmissionFailed); });
+            deferred_invoke([this] { did_fail(Core::NetworkJob::Error::TransmissionFailed); });
     });
     register_on_ready_to_read([this] {
         if (is_cancelled())
@@ -66,19 +66,19 @@ void Job::on_socket_connected()
             auto line = read_line(PAGE_SIZE);
             if (line.is_null()) {
                 warnln("Job: Expected status line");
-                return deferred_invoke([this](auto&) { did_fail(Core::NetworkJob::Error::TransmissionFailed); });
+                return deferred_invoke([this] { did_fail(Core::NetworkJob::Error::TransmissionFailed); });
             }
 
             auto parts = line.split_limit(' ', 2);
             if (parts.size() != 2) {
                 warnln("Job: Expected 2-part status line, got '{}'", line);
-                return deferred_invoke([this](auto&) { did_fail(Core::NetworkJob::Error::ProtocolFailed); });
+                return deferred_invoke([this] { did_fail(Core::NetworkJob::Error::ProtocolFailed); });
             }
 
             auto status = parts[0].to_uint();
             if (!status.has_value()) {
                 warnln("Job: Expected numeric status code");
-                return deferred_invoke([this](auto&) { did_fail(Core::NetworkJob::Error::ProtocolFailed); });
+                return deferred_invoke([this] { did_fail(Core::NetworkJob::Error::ProtocolFailed); });
             }
 
             m_status = status.value();
@@ -98,7 +98,7 @@ void Job::on_socket_connected()
                 m_state = State::InBody;
             } else {
                 warnln("Job: Expected status between 10 and 69; instead got {}", m_status);
-                return deferred_invoke([this](auto&) { did_fail(Core::NetworkJob::Error::ProtocolFailed); });
+                return deferred_invoke([this] { did_fail(Core::NetworkJob::Error::ProtocolFailed); });
             }
 
             return;
@@ -117,7 +117,7 @@ void Job::on_socket_connected()
                 }
 
                 if (should_fail_on_empty_payload()) {
-                    deferred_invoke([this](auto&) { did_fail(Core::NetworkJob::Error::ProtocolFailed); });
+                    deferred_invoke([this] { did_fail(Core::NetworkJob::Error::ProtocolFailed); });
                     return IterationDecision::Break;
                 }
             }
@@ -126,7 +126,7 @@ void Job::on_socket_connected()
             m_received_size += payload.size();
             flush_received_buffers();
 
-            deferred_invoke([this](auto&) { did_progress({}, m_received_size); });
+            deferred_invoke([this] { did_progress({}, m_received_size); });
 
             return IterationDecision::Continue;
         });
@@ -147,14 +147,14 @@ void Job::finish_up()
         // before we can actually call `did_finish`. in a normal flow, this should
         // never be hit since the client is reading as we are writing, unless there
         // are too many concurrent downloads going on.
-        deferred_invoke([this](auto&) {
+        deferred_invoke([this] {
             finish_up();
         });
         return;
     }
 
     auto response = GeminiResponse::create(m_status, m_meta);
-    deferred_invoke([this, response](auto&) {
+    deferred_invoke([this, response] {
         did_finish(move(response));
     });
 }

+ 2 - 2
Userland/Libraries/LibHTTP/HttpJob.cpp

@@ -22,13 +22,13 @@ void HttpJob::start()
     };
     m_socket->on_error = [this] {
         dbgln_if(CHTTPJOB_DEBUG, "HttpJob: on_error callback");
-        deferred_invoke([this](auto&) {
+        deferred_invoke([this] {
             did_fail(Core::NetworkJob::Error::ConnectionFailed);
         });
     };
     bool success = m_socket->connect(m_request.url().host(), m_request.url().port());
     if (!success) {
-        deferred_invoke([this](auto&) {
+        deferred_invoke([this] {
             return did_fail(Core::NetworkJob::Error::ConnectionFailed);
         });
     }

+ 4 - 4
Userland/Libraries/LibHTTP/HttpsJob.cpp

@@ -25,15 +25,15 @@ void HttpsJob::start()
     };
     m_socket->on_tls_error = [&](TLS::AlertDescription error) {
         if (error == TLS::AlertDescription::HandshakeFailure) {
-            deferred_invoke([this](auto&) {
+            deferred_invoke([this] {
                 return did_fail(Core::NetworkJob::Error::ProtocolFailed);
             });
         } else if (error == TLS::AlertDescription::DecryptError) {
-            deferred_invoke([this](auto&) {
+            deferred_invoke([this] {
                 return did_fail(Core::NetworkJob::Error::ConnectionFailed);
             });
         } else {
-            deferred_invoke([this](auto&) {
+            deferred_invoke([this] {
                 return did_fail(Core::NetworkJob::Error::TransmissionFailed);
             });
         }
@@ -48,7 +48,7 @@ void HttpsJob::start()
     };
     bool success = ((TLS::TLSv12&)*m_socket).connect(m_request.url().host(), m_request.url().port());
     if (!success) {
-        deferred_invoke([this](auto&) {
+        deferred_invoke([this] {
             return did_fail(Core::NetworkJob::Error::ConnectionFailed);
         });
     }

+ 10 - 10
Userland/Libraries/LibHTTP/Job.cpp

@@ -118,7 +118,7 @@ void Job::on_socket_connected()
 
         bool success = write(raw_request);
         if (!success)
-            deferred_invoke([this](auto&) { did_fail(Core::NetworkJob::Error::TransmissionFailed); });
+            deferred_invoke([this] { did_fail(Core::NetworkJob::Error::TransmissionFailed); });
     });
     register_on_ready_to_read([&] {
         if (is_cancelled())
@@ -137,17 +137,17 @@ void Job::on_socket_connected()
             auto line = read_line(PAGE_SIZE);
             if (line.is_null()) {
                 warnln("Job: Expected HTTP status");
-                return deferred_invoke([this](auto&) { did_fail(Core::NetworkJob::Error::TransmissionFailed); });
+                return deferred_invoke([this] { did_fail(Core::NetworkJob::Error::TransmissionFailed); });
             }
             auto parts = line.split_view(' ');
             if (parts.size() < 3) {
                 warnln("Job: Expected 3-part HTTP status, got '{}'", line);
-                return deferred_invoke([this](auto&) { did_fail(Core::NetworkJob::Error::ProtocolFailed); });
+                return deferred_invoke([this] { did_fail(Core::NetworkJob::Error::ProtocolFailed); });
             }
             auto code = parts[1].to_uint();
             if (!code.has_value()) {
                 warnln("Job: Expected numeric HTTP status");
-                return deferred_invoke([this](auto&) { did_fail(Core::NetworkJob::Error::ProtocolFailed); });
+                return deferred_invoke([this] { did_fail(Core::NetworkJob::Error::ProtocolFailed); });
             }
             m_code = code.value();
             m_state = State::InHeaders;
@@ -186,7 +186,7 @@ void Job::on_socket_connected()
                     return finish_up();
                 }
                 warnln("Job: Expected HTTP header with key/value");
-                return deferred_invoke([this](auto&) { did_fail(Core::NetworkJob::Error::ProtocolFailed); });
+                return deferred_invoke([this] { did_fail(Core::NetworkJob::Error::ProtocolFailed); });
             }
             auto name = parts[0];
             if (line.length() < name.length() + 2) {
@@ -197,7 +197,7 @@ void Job::on_socket_connected()
                     return finish_up();
                 }
                 warnln("Job: Malformed HTTP header: '{}' ({})", line, line.length());
-                return deferred_invoke([this](auto&) { did_fail(Core::NetworkJob::Error::ProtocolFailed); });
+                return deferred_invoke([this] { did_fail(Core::NetworkJob::Error::ProtocolFailed); });
             }
             auto value = line.substring(name.length() + 2, line.length() - name.length() - 2);
             m_headers.set(name, value);
@@ -238,7 +238,7 @@ void Job::on_socket_connected()
                         auto size = strtoul(size_string.characters(), &endptr, 16);
                         if (*endptr) {
                             // invalid number
-                            deferred_invoke([this](auto&) { did_fail(Core::NetworkJob::Error::TransmissionFailed); });
+                            deferred_invoke([this] { did_fail(Core::NetworkJob::Error::TransmissionFailed); });
                             return IterationDecision::Break;
                         }
                         if (size == 0) {
@@ -287,7 +287,7 @@ void Job::on_socket_connected()
                 }
 
                 if (should_fail_on_empty_payload()) {
-                    deferred_invoke([this](auto&) { did_fail(Core::NetworkJob::Error::ProtocolFailed); });
+                    deferred_invoke([this] { did_fail(Core::NetworkJob::Error::ProtocolFailed); });
                     return IterationDecision::Break;
                 }
             }
@@ -330,7 +330,7 @@ void Job::on_socket_connected()
                     content_length = length.value();
             }
 
-            deferred_invoke([this, content_length](auto&) { did_progress(content_length, m_received_size); });
+            deferred_invoke([this, content_length] { did_progress(content_length, m_received_size); });
 
             if (content_length.has_value()) {
                 auto length = content_length.value();
@@ -397,7 +397,7 @@ void Job::finish_up()
 
     m_has_scheduled_finish = true;
     auto response = HttpResponse::create(m_code, move(m_headers));
-    deferred_invoke([this, response = move(response)](auto&) {
+    deferred_invoke([this, response = move(response)] {
         did_finish(response);
     });
 }

+ 2 - 2
Userland/Libraries/LibIPC/Connection.h

@@ -196,7 +196,7 @@ protected:
             }
             if (nread == 0) {
                 if (bytes.is_empty()) {
-                    deferred_invoke([this](auto&) { shutdown(); });
+                    deferred_invoke([this] { shutdown(); });
                     return false;
                 }
                 break;
@@ -241,7 +241,7 @@ protected:
         }
 
         if (!m_unprocessed_messages.is_empty()) {
-            deferred_invoke([this](auto&) {
+            deferred_invoke([this] {
                 handle_messages();
             });
         }

+ 4 - 4
Userland/Libraries/LibLine/Editor.cpp

@@ -607,7 +607,7 @@ void Editor::resized()
         if (set_origin(false)) {
             handle_resize_event(false);
         } else {
-            deferred_invoke([this](auto&) { handle_resize_event(true); });
+            deferred_invoke([this] { handle_resize_event(true); });
             m_has_origin_reset_scheduled = true;
         }
     }
@@ -618,7 +618,7 @@ void Editor::handle_resize_event(bool reset_origin)
     m_has_origin_reset_scheduled = false;
     if (reset_origin && !set_origin(false)) {
         m_has_origin_reset_scheduled = true;
-        return deferred_invoke([this](auto&) { handle_resize_event(true); });
+        return deferred_invoke([this] { handle_resize_event(true); });
     }
 
     set_origin(m_origin_row, 1);
@@ -722,7 +722,7 @@ auto Editor::get_line(const String& prompt) -> Result<String, Editor::Error>
 
     m_notifier->on_ready_to_read = [&] { try_update_once(); };
     if (!m_incomplete_data.is_empty())
-        deferred_invoke([&](auto&) { try_update_once(); });
+        deferred_invoke([&] { try_update_once(); });
 
     if (loop.exec() == Retry)
         return get_line(prompt);
@@ -1166,7 +1166,7 @@ void Editor::handle_read_event()
     }
 
     if (!m_incomplete_data.is_empty() && !m_finish)
-        deferred_invoke([&](auto&) { try_update_once(); });
+        deferred_invoke([&] { try_update_once(); });
 }
 
 void Editor::cleanup_suggestions()

+ 1 - 1
Userland/Libraries/LibLine/InternalFunctions.cpp

@@ -265,7 +265,7 @@ void Editor::enter_search()
             search_editor.finish();
             m_reset_buffer_on_search_end = true;
             search_editor.end_search();
-            search_editor.deferred_invoke([&search_editor](auto&) { search_editor.really_quit_event_loop(); });
+            search_editor.deferred_invoke([&search_editor] { search_editor.really_quit_event_loop(); });
             return false;
         });
 

+ 1 - 1
Userland/Libraries/LibTLS/Record.cpp

@@ -41,7 +41,7 @@ void TLSv12::write_packet(ByteBuffer& packet)
     if (m_context.connection_status > ConnectionStatus::Disconnected) {
         if (!m_has_scheduled_write_flush) {
             dbgln_if(TLS_DEBUG, "Scheduling write of {}", m_context.tls_buffer.size());
-            deferred_invoke([this](auto&) { write_into_socket(); });
+            deferred_invoke([this] { write_into_socket(); });
             m_has_scheduled_write_flush = true;
         } else {
             // multiple packet are available, let's flush some out

+ 2 - 2
Userland/Libraries/LibTLS/Socket.cpp

@@ -97,7 +97,7 @@ bool TLSv12::common_connect(const struct sockaddr* saddr, socklen_t length)
         auto packet = build_hello();
         write_packet(packet);
 
-        deferred_invoke([&](auto&) {
+        deferred_invoke([&] {
             m_handshake_timeout_timer = Core::Timer::create_single_shot(
                 m_max_wait_time_for_handshake_in_seconds * 1000, [&] {
                     auto timeout_diff = Core::DateTime::now().timestamp() - m_context.handshake_initiation_timestamp;
@@ -141,7 +141,7 @@ void TLSv12::read_from_socket()
     auto notify_client_for_app_data = [&] {
         if (m_context.application_buffer.size() > 0) {
             if (!did_schedule_read) {
-                deferred_invoke([&](auto&) { read_from_socket(); });
+                deferred_invoke([&] { read_from_socket(); });
                 did_schedule_read = true;
             }
             if (on_tls_ready_to_read)

+ 4 - 4
Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp

@@ -106,7 +106,7 @@ void ResourceLoader::load(const LoadRequest& request, Function<void(ReadonlyByte
 
     if (url.protocol() == "about") {
         dbgln_if(SPAM_DEBUG, "Loading about: URL {}", url);
-        deferred_invoke([success_callback = move(success_callback)](auto&) {
+        deferred_invoke([success_callback = move(success_callback)] {
             success_callback(String::empty().to_byte_buffer(), {}, {});
         });
         return;
@@ -124,7 +124,7 @@ void ResourceLoader::load(const LoadRequest& request, Function<void(ReadonlyByte
         else
             data = url.data_payload().to_byte_buffer();
 
-        deferred_invoke([data = move(data), success_callback = move(success_callback)](auto&) {
+        deferred_invoke([data = move(data), success_callback = move(success_callback)] {
             success_callback(data, {}, {});
         });
         return;
@@ -141,7 +141,7 @@ void ResourceLoader::load(const LoadRequest& request, Function<void(ReadonlyByte
         }
 
         auto data = f->read_all();
-        deferred_invoke([data = move(data), success_callback = move(success_callback)](auto&) {
+        deferred_invoke([data = move(data), success_callback = move(success_callback)] {
             success_callback(data, {}, {});
         });
         return;
@@ -171,7 +171,7 @@ void ResourceLoader::load(const LoadRequest& request, Function<void(ReadonlyByte
                     error_callback("HTTP load failed", {});
                 return;
             }
-            deferred_invoke([protocol_request](auto&) {
+            deferred_invoke([protocol_request] {
                 // Clear circular reference of `protocol_request` captured by copy
                 const_cast<Protocol::Request&>(*protocol_request).on_buffered_request_finish = nullptr;
             });

+ 1 - 1
Userland/Libraries/LibWeb/OutOfProcessWebView.cpp

@@ -64,7 +64,7 @@ void OutOfProcessWebView::create_client()
 
     m_client_state.client = WebContentClient::construct(*this);
     m_client_state.client->on_web_content_process_crash = [this] {
-        deferred_invoke([this](auto&) {
+        deferred_invoke([this] {
             handle_web_content_process_crash();
         });
     };

+ 1 - 1
Userland/Libraries/LibWebSocket/Impl/TCPWebSocketConnectionImpl.cpp

@@ -36,7 +36,7 @@ void TCPWebSocketConnectionImpl::connect(ConnectionInfo const& connection)
     };
     bool success = m_socket->connect(connection.url().host(), connection.url().port());
     if (!success) {
-        deferred_invoke([this](auto&) {
+        deferred_invoke([this] {
             on_connection_error();
         });
     }

+ 1 - 1
Userland/Libraries/LibWebSocket/Impl/TLSv12WebSocketConnectionImpl.cpp

@@ -44,7 +44,7 @@ void TLSv12WebSocketConnectionImpl::connect(ConnectionInfo const& connection)
     };
     bool success = m_socket->connect(connection.url().host(), connection.url().port());
     if (!success) {
-        deferred_invoke([this](auto&) {
+        deferred_invoke([this] {
             on_connection_error();
         });
     }

+ 2 - 2
Userland/Services/SQLServer/DatabaseConnection.cpp

@@ -38,7 +38,7 @@ DatabaseConnection::DatabaseConnection(String database_name, int client_id)
 
     dbgln_if(SQLSERVER_DEBUG, "DatabaseConnection {} initiating connection with database '{}'", connection_id(), m_database_name);
     s_connections.set(m_connection_id, *this);
-    deferred_invoke([&](Object&) {
+    deferred_invoke([&] {
         m_database = SQL::Database::construct(String::formatted("/home/anon/sql/{}.db", m_database_name));
         m_accept_statements = true;
         auto client_connection = ClientConnection::client_connection_for(m_client_id);
@@ -53,7 +53,7 @@ void DatabaseConnection::disconnect()
 {
     dbgln_if(SQLSERVER_DEBUG, "DatabaseConnection::disconnect(connection_id {}, database '{}'", connection_id(), m_database_name);
     m_accept_statements = false;
-    deferred_invoke([&](Object&) {
+    deferred_invoke([&] {
         m_database = nullptr;
         s_connections.remove(m_connection_id);
         auto client_connection = ClientConnection::client_connection_for(client_id());

+ 2 - 2
Userland/Services/SQLServer/SQLStatement.cpp

@@ -60,7 +60,7 @@ void SQLStatement::execute()
         return;
     }
 
-    deferred_invoke([&](Object&) {
+    deferred_invoke([&] {
         auto maybe_error = parse();
         if (maybe_error.has_value()) {
             report_error(maybe_error.value());
@@ -107,7 +107,7 @@ void SQLStatement::next()
     if (m_index < m_result->results().size()) {
         auto& tuple = m_result->results()[m_index++];
         client_connection->async_next_result(statement_id(), tuple.to_string_vector());
-        deferred_invoke([&](Object&) {
+        deferred_invoke([&] {
             next();
         });
     } else {

+ 1 - 4
Userland/Services/WebServer/Client.cpp

@@ -36,10 +36,7 @@ Client::Client(NonnullRefPtr<Core::TCPSocket> socket, Core::Object* parent)
 
 void Client::die()
 {
-    deferred_invoke([this](auto& object) {
-        NonnullRefPtr protector { object };
-        remove_from_parent();
-    });
+    deferred_invoke([this] { remove_from_parent(); });
 }
 
 void Client::start()

+ 1 - 1
Userland/Services/WebSocket/ClientConnection.cpp

@@ -126,7 +126,7 @@ void ClientConnection::did_error(i32 connection_id, i32 message)
 void ClientConnection::did_close(i32 connection_id, u16 code, String reason, bool was_clean)
 {
     async_closed(connection_id, code, reason, was_clean);
-    deferred_invoke([this, connection_id](auto&) {
+    deferred_invoke([this, connection_id] {
         m_connections.remove(connection_id);
     });
 }

+ 1 - 1
Userland/Services/WindowServer/ClientConnection.cpp

@@ -79,7 +79,7 @@ ClientConnection::~ClientConnection()
 
 void ClientConnection::die()
 {
-    deferred_invoke([this](auto&) {
+    deferred_invoke([this] {
         s_connections->remove(client_id());
     });
 }

+ 1 - 1
Userland/Services/WindowServer/WMClientConnection.cpp

@@ -28,7 +28,7 @@ WMClientConnection::~WMClientConnection()
 
 void WMClientConnection::die()
 {
-    deferred_invoke([this](auto&) {
+    deferred_invoke([this] {
         s_connections.remove(client_id());
     });
 }

+ 1 - 1
Userland/Services/WindowServer/Window.cpp

@@ -764,7 +764,7 @@ void Window::request_update(const Gfx::IntRect& rect, bool ignore_occlusion)
     if (rect.is_empty())
         return;
     if (m_pending_paint_rects.is_empty()) {
-        deferred_invoke([this, ignore_occlusion](auto&) {
+        deferred_invoke([this, ignore_occlusion] {
             client()->post_paint_message(*this, ignore_occlusion);
         });
     }

+ 1 - 1
Userland/Shell/Shell.cpp

@@ -958,7 +958,7 @@ void Shell::run_tail(const AST::Command& invoking_command, const AST::NodeWithAc
 void Shell::run_tail(RefPtr<Job> job)
 {
     if (auto cmd = job->command_ptr()) {
-        deferred_invoke([=, this](auto&) {
+        deferred_invoke([=, this] {
             for (auto& next_in_chain : cmd->next_chain) {
                 run_tail(*cmd, next_in_chain, job->exit_code());
             }