Try ripping out inferred types because it might be a performance improvement
[WebKit-https.git] / Source / JavaScriptCore / inspector / InspectorFrontendRouter.cpp
index 287a678..d408d36 100644 (file)
@@ -36,28 +36,24 @@ Ref<FrontendRouter> FrontendRouter::create()
     return adoptRef(*new FrontendRouter);
 }
 
-void FrontendRouter::connectFrontend(FrontendChannel* connection)
+void FrontendRouter::connectFrontend(FrontendChannel& connection)
 {
-    ASSERT_ARG(connection, connection);
-
-    if (m_connections.contains(connection)) {
+    if (m_connections.contains(&connection)) {
         ASSERT_NOT_REACHED();
         return;
     }
 
-    m_connections.append(connection);
+    m_connections.append(&connection);
 }
 
-void FrontendRouter::disconnectFrontend(FrontendChannel* connection)
+void FrontendRouter::disconnectFrontend(FrontendChannel& connection)
 {
-    ASSERT_ARG(connection, connection);
-
-    if (!m_connections.contains(connection)) {
+    if (!m_connections.contains(&connection)) {
         ASSERT_NOT_REACHED();
         return;
     }
 
-    m_connections.removeFirst(connection);
+    m_connections.removeFirst(&connection);
 }
 
 void FrontendRouter::disconnectAllFrontends()
@@ -65,15 +61,6 @@ void FrontendRouter::disconnectAllFrontends()
     m_connections.clear();
 }
 
-// FIXME: <https://webkit.org/b/148492> remove this method once agents move to using FrontendRouter directly.
-FrontendChannel* FrontendRouter::leakChannel() const
-{
-    if (m_connections.size())
-        return m_connections.at(0);
-
-    return nullptr;
-}
-
 bool FrontendRouter::hasLocalFrontend() const
 {
     for (auto* connection : m_connections) {