Title: [238206] trunk/Source
Revision
238206
Author
joep...@webkit.org
Date
2018-11-14 15:56:07 -0800 (Wed, 14 Nov 2018)

Log Message

Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods
https://bugs.webkit.org/show_bug.cgi?id=191612

Reviewed by Matt Baker.

Source/_javascript_Core:

* inspector/InspectorFrontendRouter.cpp:
(Inspector::FrontendRouter::connectFrontend):
(Inspector::FrontendRouter::disconnectFrontend):
* inspector/InspectorFrontendRouter.h:
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::connectFrontend):
(Inspector::JSGlobalObjectInspectorController::disconnectFrontend):
* inspector/JSGlobalObjectInspectorController.h:
* inspector/remote/RemoteControllableTarget.h:
* inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm:
(Inspector::RemoteConnectionToTarget::setup):
(Inspector::RemoteConnectionToTarget::close):
* inspector/remote/glib/RemoteConnectionToTargetGlib.cpp:
(Inspector::RemoteConnectionToTarget::setup):
(Inspector::RemoteConnectionToTarget::close):
* runtime/JSGlobalObjectDebuggable.cpp:
(JSC::JSGlobalObjectDebuggable::connect):
(JSC::JSGlobalObjectDebuggable::disconnect):
* runtime/JSGlobalObjectDebuggable.h:

Source/WebCore:

* inspector/InspectorController.cpp:
(WebCore::InspectorController::connectFrontend):
(WebCore::InspectorController::disconnectFrontend):
(WebCore::InspectorController::show):
* inspector/InspectorController.h:
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::connectFrontend):
(WebCore::WorkerInspectorController::disconnectFrontend):
* page/PageDebuggable.cpp:
(WebCore::PageDebuggable::connect):
(WebCore::PageDebuggable::disconnect):
* page/PageDebuggable.h:
* testing/Internals.cpp:
(WebCore::InspectorStubFrontend::InspectorStubFrontend):
(WebCore::InspectorStubFrontend::closeWindow):
* workers/service/context/ServiceWorkerDebuggable.cpp:
(WebCore::ServiceWorkerDebuggable::connect):
(WebCore::ServiceWorkerDebuggable::disconnect):
* workers/service/context/ServiceWorkerDebuggable.h:
* workers/service/context/ServiceWorkerInspectorProxy.cpp:
(WebCore::ServiceWorkerInspectorProxy::connectToWorker):
(WebCore::ServiceWorkerInspectorProxy::disconnectFromWorker):
* workers/service/context/ServiceWorkerInspectorProxy.h:

Source/WebKit:

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::connect):
(WebKit::WebAutomationSession::disconnect):
(WebKit::WebAutomationSession::terminate):
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/WebPageDebuggable.cpp:
(WebKit::WebPageDebuggable::connect):
(WebKit::WebPageDebuggable::disconnect):
* UIProcess/WebPageDebuggable.h:
* UIProcess/WebPageInspectorController.cpp:
(WebKit::WebPageInspectorController::connectFrontend):
(WebKit::WebPageInspectorController::disconnectFrontend):
* UIProcess/WebPageInspectorController.h:
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::close):
* WebProcess/WebPage/WebPageInspectorTarget.cpp:
(WebKit::WebPageInspectorTarget::connect):
(WebKit::WebPageInspectorTarget::disconnect):

Source/WebKitLegacy/mac:

* WebCoreSupport/WebInspectorClient.mm:
(-[WebInspectorWindowController destroyInspectorView]):

Source/WebKitLegacy/win:

* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorFrontendClient::destroyInspectorView):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (238205 => 238206)


--- trunk/Source/_javascript_Core/ChangeLog	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-11-14 23:56:07 UTC (rev 238206)
@@ -1,5 +1,32 @@
 2018-11-14  Joseph Pecoraro  <pecor...@apple.com>
 
+        Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods
+        https://bugs.webkit.org/show_bug.cgi?id=191612
+
+        Reviewed by Matt Baker.
+
+        * inspector/InspectorFrontendRouter.cpp:
+        (Inspector::FrontendRouter::connectFrontend):
+        (Inspector::FrontendRouter::disconnectFrontend):
+        * inspector/InspectorFrontendRouter.h:
+        * inspector/JSGlobalObjectInspectorController.cpp:
+        (Inspector::JSGlobalObjectInspectorController::connectFrontend):
+        (Inspector::JSGlobalObjectInspectorController::disconnectFrontend):
+        * inspector/JSGlobalObjectInspectorController.h:
+        * inspector/remote/RemoteControllableTarget.h:
+        * inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm:
+        (Inspector::RemoteConnectionToTarget::setup):
+        (Inspector::RemoteConnectionToTarget::close):
+        * inspector/remote/glib/RemoteConnectionToTargetGlib.cpp:
+        (Inspector::RemoteConnectionToTarget::setup):
+        (Inspector::RemoteConnectionToTarget::close):
+        * runtime/JSGlobalObjectDebuggable.cpp:
+        (JSC::JSGlobalObjectDebuggable::connect):
+        (JSC::JSGlobalObjectDebuggable::disconnect):
+        * runtime/JSGlobalObjectDebuggable.h:
+
+2018-11-14  Joseph Pecoraro  <pecor...@apple.com>
+
         Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Remote Inspector)
         https://bugs.webkit.org/show_bug.cgi?id=191494
         <rdar://problem/45469854>

Modified: trunk/Source/_javascript_Core/inspector/InspectorFrontendRouter.cpp (238205 => 238206)


--- trunk/Source/_javascript_Core/inspector/InspectorFrontendRouter.cpp	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/_javascript_Core/inspector/InspectorFrontendRouter.cpp	2018-11-14 23:56:07 UTC (rev 238206)
@@ -36,28 +36,24 @@
     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()

Modified: trunk/Source/_javascript_Core/inspector/InspectorFrontendRouter.h (238205 => 238206)


--- trunk/Source/_javascript_Core/inspector/InspectorFrontendRouter.h	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/_javascript_Core/inspector/InspectorFrontendRouter.h	2018-11-14 23:56:07 UTC (rev 238206)
@@ -43,8 +43,8 @@
 
     unsigned frontendCount() const { return m_connections.size(); }
 
-    void connectFrontend(FrontendChannel*);
-    void disconnectFrontend(FrontendChannel*);
+    void connectFrontend(FrontendChannel&);
+    void disconnectFrontend(FrontendChannel&);
     void disconnectAllFrontends();
 
     void sendEvent(const String& message) const;

Modified: trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.cpp (238205 => 238206)


--- trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.cpp	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.cpp	2018-11-14 23:56:07 UTC (rev 238206)
@@ -119,10 +119,8 @@
     m_agents.discardValues();
 }
 
-void JSGlobalObjectInspectorController::connectFrontend(FrontendChannel* frontendChannel, bool isAutomaticInspection, bool immediatelyPause)
+void JSGlobalObjectInspectorController::connectFrontend(FrontendChannel& frontendChannel, bool isAutomaticInspection, bool immediatelyPause)
 {
-    ASSERT_ARG(frontendChannel, frontendChannel);
-
     m_isAutomaticInspection = isAutomaticInspection;
     m_pauseAfterInitialization = immediatelyPause;
 
@@ -147,10 +145,8 @@
 #endif
 }
 
-void JSGlobalObjectInspectorController::disconnectFrontend(FrontendChannel* frontendChannel)
+void JSGlobalObjectInspectorController::disconnectFrontend(FrontendChannel& frontendChannel)
 {
-    ASSERT_ARG(frontendChannel, frontendChannel);
-
     // FIXME: change this to notify agents which frontend has disconnected (by id).
     m_agents.willDestroyFrontendAndBackend(DisconnectReason::InspectorDestroyed);
 

Modified: trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.h (238205 => 238206)


--- trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.h	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.h	2018-11-14 23:56:07 UTC (rev 238206)
@@ -68,8 +68,8 @@
     JSGlobalObjectInspectorController(JSC::JSGlobalObject&);
     ~JSGlobalObjectInspectorController();
 
-    void connectFrontend(FrontendChannel*, bool isAutomaticInspection, bool immediatelyPause);
-    void disconnectFrontend(FrontendChannel*);
+    void connectFrontend(FrontendChannel&, bool isAutomaticInspection, bool immediatelyPause);
+    void disconnectFrontend(FrontendChannel&);
 
     void dispatchMessageFromFrontend(const String&);
 

Modified: trunk/Source/_javascript_Core/inspector/remote/RemoteControllableTarget.h (238205 => 238206)


--- trunk/Source/_javascript_Core/inspector/remote/RemoteControllableTarget.h	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/_javascript_Core/inspector/remote/RemoteControllableTarget.h	2018-11-14 23:56:07 UTC (rev 238206)
@@ -45,8 +45,8 @@
     void init();
     void update();
 
-    virtual void connect(FrontendChannel*, bool isAutomaticConnection = false, bool immediatelyPause = false) = 0;
-    virtual void disconnect(FrontendChannel*) = 0;
+    virtual void connect(FrontendChannel&, bool isAutomaticConnection = false, bool immediatelyPause = false) = 0;
+    virtual void disconnect(FrontendChannel&) = 0;
 
     unsigned targetIdentifier() const { return m_identifier; }
     void setTargetIdentifier(unsigned identifier) { m_identifier = identifier; }

Modified: trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm (238205 => 238206)


--- trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm	2018-11-14 23:56:07 UTC (rev 238206)
@@ -171,13 +171,13 @@
                 m_target = nullptr;
             } else if (is<RemoteInspectionTarget>(m_target)) {
                 auto castedTarget = downcast<RemoteInspectionTarget>(m_target);
-                castedTarget->connect(this, isAutomaticInspection, automaticallyPause);
+                castedTarget->connect(*this, isAutomaticInspection, automaticallyPause);
                 m_connected = true;
 
                 RemoteInspector::singleton().updateTargetListing(targetIdentifier);
             } else if (is<RemoteAutomationTarget>(m_target)) {
                 auto castedTarget = downcast<RemoteAutomationTarget>(m_target);
-                castedTarget->connect(this);
+                castedTarget->connect(*this);
                 m_connected = true;
 
                 RemoteInspector::singleton().updateTargetListing(targetIdentifier);
@@ -206,7 +206,7 @@
             std::lock_guard<Lock> lock(m_targetMutex);
             if (m_target) {
                 if (m_connected)
-                    m_target->disconnect(this);
+                    m_target->disconnect(*this);
 
                 m_target = nullptr;
                 

Modified: trunk/Source/_javascript_Core/inspector/remote/glib/RemoteConnectionToTargetGlib.cpp (238205 => 238206)


--- trunk/Source/_javascript_Core/inspector/remote/glib/RemoteConnectionToTargetGlib.cpp	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/_javascript_Core/inspector/remote/glib/RemoteConnectionToTargetGlib.cpp	2018-11-14 23:56:07 UTC (rev 238206)
@@ -56,13 +56,13 @@
         m_target = nullptr;
     } else if (is<RemoteInspectionTarget>(m_target)) {
         auto target = downcast<RemoteInspectionTarget>(m_target);
-        target->connect(this, isAutomaticInspection, automaticallyPause);
+        target->connect(*this, isAutomaticInspection, automaticallyPause);
         m_connected = true;
 
         RemoteInspector::singleton().updateTargetListing(targetIdentifier);
     } else if (is<RemoteAutomationTarget>(m_target)) {
         auto target = downcast<RemoteAutomationTarget>(m_target);
-        target->connect(this);
+        target->connect(*this);
         m_connected = true;
 
         RemoteInspector::singleton().updateTargetListing(targetIdentifier);
@@ -93,7 +93,7 @@
     unsigned targetIdentifier = m_target->targetIdentifier();
 
     if (m_connected)
-        m_target->disconnect(this);
+        m_target->disconnect(*this);
 
     m_target = nullptr;
 

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObjectDebuggable.cpp (238205 => 238206)


--- trunk/Source/_javascript_Core/runtime/JSGlobalObjectDebuggable.cpp	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObjectDebuggable.cpp	2018-11-14 23:56:07 UTC (rev 238206)
@@ -50,7 +50,7 @@
     return name.isEmpty() ? "JSContext"_s : name;
 }
 
-void JSGlobalObjectDebuggable::connect(FrontendChannel* frontendChannel, bool automaticInspection, bool immediatelyPause)
+void JSGlobalObjectDebuggable::connect(FrontendChannel& frontendChannel, bool automaticInspection, bool immediatelyPause)
 {
     JSLockHolder locker(&m_globalObject.vm());
 
@@ -57,7 +57,7 @@
     m_globalObject.inspectorController().connectFrontend(frontendChannel, automaticInspection, immediatelyPause);
 }
 
-void JSGlobalObjectDebuggable::disconnect(FrontendChannel* frontendChannel)
+void JSGlobalObjectDebuggable::disconnect(FrontendChannel& frontendChannel)
 {
     JSLockHolder locker(&m_globalObject.vm());
 

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObjectDebuggable.h (238205 => 238206)


--- trunk/Source/_javascript_Core/runtime/JSGlobalObjectDebuggable.h	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObjectDebuggable.h	2018-11-14 23:56:07 UTC (rev 238206)
@@ -51,8 +51,8 @@
     String name() const final;
     bool hasLocalDebugger() const final { return false; }
 
-    void connect(Inspector::FrontendChannel*, bool isAutomaticConnection = false, bool immediatelyPause = false) final;
-    void disconnect(Inspector::FrontendChannel*) final;
+    void connect(Inspector::FrontendChannel&, bool isAutomaticConnection = false, bool immediatelyPause = false) final;
+    void disconnect(Inspector::FrontendChannel&) final;
     void dispatchMessageFromRemote(const String& message) final;
 
     bool automaticInspectionAllowed() const final { return true; }

Modified: trunk/Source/WebCore/ChangeLog (238205 => 238206)


--- trunk/Source/WebCore/ChangeLog	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebCore/ChangeLog	2018-11-14 23:56:07 UTC (rev 238206)
@@ -1,3 +1,34 @@
+2018-11-14  Joseph Pecoraro  <pecor...@apple.com>
+
+        Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods
+        https://bugs.webkit.org/show_bug.cgi?id=191612
+
+        Reviewed by Matt Baker.
+
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::connectFrontend):
+        (WebCore::InspectorController::disconnectFrontend):
+        (WebCore::InspectorController::show):
+        * inspector/InspectorController.h:
+        * inspector/WorkerInspectorController.cpp:
+        (WebCore::WorkerInspectorController::connectFrontend):
+        (WebCore::WorkerInspectorController::disconnectFrontend):
+        * page/PageDebuggable.cpp:
+        (WebCore::PageDebuggable::connect):
+        (WebCore::PageDebuggable::disconnect):
+        * page/PageDebuggable.h:
+        * testing/Internals.cpp:
+        (WebCore::InspectorStubFrontend::InspectorStubFrontend):
+        (WebCore::InspectorStubFrontend::closeWindow):
+        * workers/service/context/ServiceWorkerDebuggable.cpp:
+        (WebCore::ServiceWorkerDebuggable::connect):
+        (WebCore::ServiceWorkerDebuggable::disconnect):
+        * workers/service/context/ServiceWorkerDebuggable.h:
+        * workers/service/context/ServiceWorkerInspectorProxy.cpp:
+        (WebCore::ServiceWorkerInspectorProxy::connectToWorker):
+        (WebCore::ServiceWorkerInspectorProxy::disconnectFromWorker):
+        * workers/service/context/ServiceWorkerInspectorProxy.h:
+
 2018-11-14  Timothy Hatcher  <timo...@apple.com>
 
         Update prefers-color-scheme media query matching based on GitHub issue #3278.

Modified: trunk/Source/WebCore/inspector/InspectorController.cpp (238205 => 238206)


--- trunk/Source/WebCore/inspector/InspectorController.cpp	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebCore/inspector/InspectorController.cpp	2018-11-14 23:56:07 UTC (rev 238206)
@@ -254,9 +254,8 @@
         m_inspectorFrontendClient->windowObjectCleared();
 }
 
-void InspectorController::connectFrontend(Inspector::FrontendChannel* frontendChannel, bool isAutomaticInspection, bool immediatelyPause)
+void InspectorController::connectFrontend(Inspector::FrontendChannel& frontendChannel, bool isAutomaticInspection, bool immediatelyPause)
 {
-    ASSERT_ARG(frontendChannel, frontendChannel);
     ASSERT(m_inspectorClient);
 
     // If a frontend has connected enable the developer extras and keep them enabled.
@@ -285,7 +284,7 @@
 #endif
 }
 
-void InspectorController::disconnectFrontend(FrontendChannel* frontendChannel)
+void InspectorController::disconnectFrontend(FrontendChannel& frontendChannel)
 {
     m_frontendRouter->disconnectFrontend(frontendChannel);
 
@@ -362,7 +361,7 @@
     if (m_frontendRouter->hasLocalFrontend())
         m_inspectorClient->bringFrontendToFront();
     else if (Inspector::FrontendChannel* frontendChannel = m_inspectorClient->openLocalFrontend(this))
-        connectFrontend(frontendChannel);
+        connectFrontend(*frontendChannel);
 }
 
 void InspectorController::setIsUnderTest(bool value)

Modified: trunk/Source/WebCore/inspector/InspectorController.h (238205 => 238206)


--- trunk/Source/WebCore/inspector/InspectorController.h	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebCore/inspector/InspectorController.h	2018-11-14 23:56:07 UTC (rev 238206)
@@ -91,8 +91,8 @@
     bool hasLocalFrontend() const;
     bool hasRemoteFrontend() const;
 
-    WEBCORE_EXPORT void connectFrontend(Inspector::FrontendChannel*, bool isAutomaticInspection = false, bool immediatelyPause = false);
-    WEBCORE_EXPORT void disconnectFrontend(Inspector::FrontendChannel*);
+    WEBCORE_EXPORT void connectFrontend(Inspector::FrontendChannel&, bool isAutomaticInspection = false, bool immediatelyPause = false);
+    WEBCORE_EXPORT void disconnectFrontend(Inspector::FrontendChannel&);
     WEBCORE_EXPORT void disconnectAllFrontends();
 
     void inspect(Node*);

Modified: trunk/Source/WebCore/inspector/WorkerInspectorController.cpp (238205 => 238206)


--- trunk/Source/WebCore/inspector/WorkerInspectorController.cpp	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebCore/inspector/WorkerInspectorController.cpp	2018-11-14 23:56:07 UTC (rev 238206)
@@ -114,7 +114,7 @@
     m_executionStopwatch->start();
 
     m_forwardingChannel = std::make_unique<WorkerToPageFrontendChannel>(m_workerGlobalScope);
-    m_frontendRouter->connectFrontend(m_forwardingChannel.get());
+    m_frontendRouter->connectFrontend(*m_forwardingChannel.get());
     m_agents.didCreateFrontendAndBackend(&m_frontendRouter.get(), &m_backendDispatcher.get());
 }
 
@@ -130,7 +130,7 @@
     });
 
     m_agents.willDestroyFrontendAndBackend(reason);
-    m_frontendRouter->disconnectFrontend(m_forwardingChannel.get());
+    m_frontendRouter->disconnectFrontend(*m_forwardingChannel.get());
     m_forwardingChannel = nullptr;
 }
 

Modified: trunk/Source/WebCore/page/PageDebuggable.cpp (238205 => 238206)


--- trunk/Source/WebCore/page/PageDebuggable.cpp	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebCore/page/PageDebuggable.cpp	2018-11-14 23:56:07 UTC (rev 238206)
@@ -69,16 +69,14 @@
     return m_page.inspectorController().hasLocalFrontend();
 }
 
-void PageDebuggable::connect(Inspector::FrontendChannel* channel, bool isAutomaticConnection, bool immediatelyPause)
+void PageDebuggable::connect(FrontendChannel& channel, bool isAutomaticConnection, bool immediatelyPause)
 {
-    InspectorController& inspectorController = m_page.inspectorController();
-    inspectorController.connectFrontend(channel, isAutomaticConnection, immediatelyPause);
+    m_page.inspectorController().connectFrontend(channel, isAutomaticConnection, immediatelyPause);
 }
 
-void PageDebuggable::disconnect(Inspector::FrontendChannel* channel)
+void PageDebuggable::disconnect(FrontendChannel& channel)
 {
-    InspectorController& inspectorController = m_page.inspectorController();
-    inspectorController.disconnectFrontend(channel);
+    m_page.inspectorController().disconnectFrontend(channel);
 }
 
 void PageDebuggable::dispatchMessageFromRemote(const String& message)

Modified: trunk/Source/WebCore/page/PageDebuggable.h (238205 => 238206)


--- trunk/Source/WebCore/page/PageDebuggable.h	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebCore/page/PageDebuggable.h	2018-11-14 23:56:07 UTC (rev 238206)
@@ -47,8 +47,8 @@
     String url() const final;
     bool hasLocalDebugger() const final;
 
-    void connect(Inspector::FrontendChannel*, bool isAutomaticConnection = false, bool immediatelyPause = false) final;
-    void disconnect(Inspector::FrontendChannel*) final;
+    void connect(Inspector::FrontendChannel&, bool isAutomaticConnection = false, bool immediatelyPause = false) final;
+    void disconnect(Inspector::FrontendChannel&) final;
     void dispatchMessageFromRemote(const String& message) final;
     void setIndicating(bool) final;
 

Modified: trunk/Source/WebCore/testing/Internals.cpp (238205 => 238206)


--- trunk/Source/WebCore/testing/Internals.cpp	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebCore/testing/Internals.cpp	2018-11-14 23:56:07 UTC (rev 238206)
@@ -335,7 +335,7 @@
     ASSERT_ARG(frontendWindow, frontendWindow);
 
     m_frontendController.setInspectorFrontendClient(this);
-    inspectedPage.inspectorController().connectFrontend(this);
+    inspectedPage.inspectorController().connectFrontend(*this);
 }
 
 InspectorStubFrontend::~InspectorStubFrontend()
@@ -349,7 +349,7 @@
         return;
 
     m_frontendController.setInspectorFrontendClient(nullptr);
-    inspectedPage()->inspectorController().disconnectFrontend(this);
+    inspectedPage()->inspectorController().disconnectFrontend(*this);
 
     m_frontendWindow->close();
     m_frontendWindow = nullptr;

Modified: trunk/Source/WebCore/workers/service/context/ServiceWorkerDebuggable.cpp (238205 => 238206)


--- trunk/Source/WebCore/workers/service/context/ServiceWorkerDebuggable.cpp	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebCore/workers/service/context/ServiceWorkerDebuggable.cpp	2018-11-14 23:56:07 UTC (rev 238206)
@@ -42,12 +42,12 @@
 {
 }
 
-void ServiceWorkerDebuggable::connect(Inspector::FrontendChannel* channel, bool, bool)
+void ServiceWorkerDebuggable::connect(FrontendChannel& channel, bool, bool)
 {
     m_serviceWorkerThreadProxy.inspectorProxy().connectToWorker(channel);
 }
 
-void ServiceWorkerDebuggable::disconnect(Inspector::FrontendChannel* channel)
+void ServiceWorkerDebuggable::disconnect(FrontendChannel& channel)
 {
     m_serviceWorkerThreadProxy.inspectorProxy().disconnectFromWorker(channel);
 }

Modified: trunk/Source/WebCore/workers/service/context/ServiceWorkerDebuggable.h (238205 => 238206)


--- trunk/Source/WebCore/workers/service/context/ServiceWorkerDebuggable.h	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebCore/workers/service/context/ServiceWorkerDebuggable.h	2018-11-14 23:56:07 UTC (rev 238206)
@@ -49,8 +49,8 @@
     String url() const final { return m_scopeURL; }
     bool hasLocalDebugger() const final { return false; }
 
-    void connect(Inspector::FrontendChannel*, bool isAutomaticConnection = false, bool immediatelyPause = false) final;
-    void disconnect(Inspector::FrontendChannel*) final;
+    void connect(Inspector::FrontendChannel&, bool isAutomaticConnection = false, bool immediatelyPause = false) final;
+    void disconnect(Inspector::FrontendChannel&) final;
     void dispatchMessageFromRemote(const String& message) final;
 
 private:

Modified: trunk/Source/WebCore/workers/service/context/ServiceWorkerInspectorProxy.cpp (238205 => 238206)


--- trunk/Source/WebCore/workers/service/context/ServiceWorkerInspectorProxy.cpp	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebCore/workers/service/context/ServiceWorkerInspectorProxy.cpp	2018-11-14 23:56:07 UTC (rev 238206)
@@ -57,9 +57,9 @@
     m_channel = nullptr;
 }
 
-void ServiceWorkerInspectorProxy::connectToWorker(FrontendChannel* channel)
+void ServiceWorkerInspectorProxy::connectToWorker(FrontendChannel& channel)
 {
-    m_channel = channel;
+    m_channel = &channel;
 
     m_serviceWorkerThreadProxy.thread().runLoop().postTaskForMode([] (ScriptExecutionContext& context) {
         downcast<WorkerGlobalScope>(context).inspectorController().connectFrontend();
@@ -66,9 +66,9 @@
     }, WorkerRunLoop::debuggerMode());
 }
 
-void ServiceWorkerInspectorProxy::disconnectFromWorker(FrontendChannel* channel)
+void ServiceWorkerInspectorProxy::disconnectFromWorker(FrontendChannel& channel)
 {
-    ASSERT_UNUSED(channel, channel == m_channel);
+    ASSERT_UNUSED(channel, &channel == m_channel);
     m_channel = nullptr;
 
     m_serviceWorkerThreadProxy.thread().runLoop().postTaskForMode([] (ScriptExecutionContext& context) {

Modified: trunk/Source/WebCore/workers/service/context/ServiceWorkerInspectorProxy.h (238205 => 238206)


--- trunk/Source/WebCore/workers/service/context/ServiceWorkerInspectorProxy.h	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebCore/workers/service/context/ServiceWorkerInspectorProxy.h	2018-11-14 23:56:07 UTC (rev 238206)
@@ -49,8 +49,8 @@
 
     void serviceWorkerTerminated();
 
-    void connectToWorker(Inspector::FrontendChannel*);
-    void disconnectFromWorker(Inspector::FrontendChannel*);
+    void connectToWorker(Inspector::FrontendChannel&);
+    void disconnectFromWorker(Inspector::FrontendChannel&);
     void sendMessageToWorker(const String&);
     void sendMessageFromWorkerToFrontend(const String&);
 

Modified: trunk/Source/WebKit/ChangeLog (238205 => 238206)


--- trunk/Source/WebKit/ChangeLog	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebKit/ChangeLog	2018-11-14 23:56:07 UTC (rev 238206)
@@ -1,5 +1,31 @@
 2018-11-14  Joseph Pecoraro  <pecor...@apple.com>
 
+        Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods
+        https://bugs.webkit.org/show_bug.cgi?id=191612
+
+        Reviewed by Matt Baker.
+
+        * UIProcess/Automation/WebAutomationSession.cpp:
+        (WebKit::WebAutomationSession::connect):
+        (WebKit::WebAutomationSession::disconnect):
+        (WebKit::WebAutomationSession::terminate):
+        * UIProcess/Automation/WebAutomationSession.h:
+        * UIProcess/WebPageDebuggable.cpp:
+        (WebKit::WebPageDebuggable::connect):
+        (WebKit::WebPageDebuggable::disconnect):
+        * UIProcess/WebPageDebuggable.h:
+        * UIProcess/WebPageInspectorController.cpp:
+        (WebKit::WebPageInspectorController::connectFrontend):
+        (WebKit::WebPageInspectorController::disconnectFrontend):
+        * UIProcess/WebPageInspectorController.h:
+        * WebProcess/WebPage/WebInspector.cpp:
+        (WebKit::WebInspector::close):
+        * WebProcess/WebPage/WebPageInspectorTarget.cpp:
+        (WebKit::WebPageInspectorTarget::connect):
+        (WebKit::WebPageInspectorTarget::disconnect):
+
+2018-11-14  Joseph Pecoraro  <pecor...@apple.com>
+
         Unreviewed attempted wincairo build fix after 238192.
 
         * WebProcess/WebPage/WebPageInspectorTargetController.h:

Modified: trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp (238205 => 238206)


--- trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp	2018-11-14 23:56:07 UTC (rev 238206)
@@ -118,20 +118,20 @@
     m_backendDispatcher->dispatch(message);
 }
 
-void WebAutomationSession::connect(Inspector::FrontendChannel* channel, bool isAutomaticConnection, bool immediatelyPause)
+void WebAutomationSession::connect(Inspector::FrontendChannel& channel, bool isAutomaticConnection, bool immediatelyPause)
 {
     UNUSED_PARAM(isAutomaticConnection);
     UNUSED_PARAM(immediatelyPause);
 
-    m_remoteChannel = channel;
+    m_remoteChannel = &channel;
     m_frontendRouter->connectFrontend(channel);
 
     setIsPaired(true);
 }
 
-void WebAutomationSession::disconnect(Inspector::FrontendChannel* channel)
+void WebAutomationSession::disconnect(Inspector::FrontendChannel& channel)
 {
-    ASSERT(channel == m_remoteChannel);
+    ASSERT(&channel == m_remoteChannel);
     terminate();
 }
 
@@ -152,7 +152,7 @@
 #if ENABLE(REMOTE_INSPECTOR)
     if (Inspector::FrontendChannel* channel = m_remoteChannel) {
         m_remoteChannel = nullptr;
-        m_frontendRouter->disconnectFrontend(channel);
+        m_frontendRouter->disconnectFrontend(*channel);
     }
 
     setIsPaired(false);

Modified: trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.h (238205 => 238206)


--- trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.h	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.h	2018-11-14 23:56:07 UTC (rev 238206)
@@ -130,8 +130,8 @@
     // Inspector::RemoteAutomationTarget API
     String name() const override { return m_sessionIdentifier; }
     void dispatchMessageFromRemote(const String& message) override;
-    void connect(Inspector::FrontendChannel*, bool isAutomaticConnection = false, bool immediatelyPause = false) override;
-    void disconnect(Inspector::FrontendChannel*) override;
+    void connect(Inspector::FrontendChannel&, bool isAutomaticConnection = false, bool immediatelyPause = false) override;
+    void disconnect(Inspector::FrontendChannel&) override;
 #endif
     void terminate();
 

Modified: trunk/Source/WebKit/UIProcess/WebPageDebuggable.cpp (238205 => 238206)


--- trunk/Source/WebKit/UIProcess/WebPageDebuggable.cpp	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebKit/UIProcess/WebPageDebuggable.cpp	2018-11-14 23:56:07 UTC (rev 238206)
@@ -66,12 +66,12 @@
     return m_page.inspectorController().hasLocalFrontend();
 }
 
-void WebPageDebuggable::connect(Inspector::FrontendChannel* channel, bool isAutomaticConnection, bool immediatelyPause)
+void WebPageDebuggable::connect(FrontendChannel& channel, bool isAutomaticConnection, bool immediatelyPause)
 {
     m_page.inspectorController().connectFrontend(channel, isAutomaticConnection, immediatelyPause);
 }
 
-void WebPageDebuggable::disconnect(Inspector::FrontendChannel* channel)
+void WebPageDebuggable::disconnect(FrontendChannel& channel)
 {
     m_page.inspectorController().disconnectFrontend(channel);
 }

Modified: trunk/Source/WebKit/UIProcess/WebPageDebuggable.h (238205 => 238206)


--- trunk/Source/WebKit/UIProcess/WebPageDebuggable.h	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebKit/UIProcess/WebPageDebuggable.h	2018-11-14 23:56:07 UTC (rev 238206)
@@ -47,8 +47,8 @@
     String url() const final;
     bool hasLocalDebugger() const final;
 
-    void connect(Inspector::FrontendChannel*, bool isAutomaticConnection = false, bool immediatelyPause = false) final;
-    void disconnect(Inspector::FrontendChannel*) final;
+    void connect(Inspector::FrontendChannel&, bool isAutomaticConnection = false, bool immediatelyPause = false) final;
+    void disconnect(Inspector::FrontendChannel&) final;
     void dispatchMessageFromRemote(const String& message) final;
     void setIndicating(bool) final;
 

Modified: trunk/Source/WebKit/UIProcess/WebPageInspectorController.cpp (238205 => 238206)


--- trunk/Source/WebKit/UIProcess/WebPageInspectorController.cpp	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebKit/UIProcess/WebPageInspectorController.cpp	2018-11-14 23:56:07 UTC (rev 238206)
@@ -62,10 +62,8 @@
     return m_frontendRouter->hasLocalFrontend();
 }
 
-void WebPageInspectorController::connectFrontend(Inspector::FrontendChannel* frontendChannel, bool, bool)
+void WebPageInspectorController::connectFrontend(Inspector::FrontendChannel& frontendChannel, bool, bool)
 {
-    ASSERT_ARG(frontendChannel, frontendChannel);
-
     bool connectingFirstFrontend = !m_frontendRouter->hasFrontends();
 
     m_frontendRouter->connectFrontend(frontendChannel);
@@ -81,7 +79,7 @@
 #endif
 }
 
-void WebPageInspectorController::disconnectFrontend(FrontendChannel* frontendChannel)
+void WebPageInspectorController::disconnectFrontend(FrontendChannel& frontendChannel)
 {
     m_frontendRouter->disconnectFrontend(frontendChannel);
 

Modified: trunk/Source/WebKit/UIProcess/WebPageInspectorController.h (238205 => 238206)


--- trunk/Source/WebKit/UIProcess/WebPageInspectorController.h	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebKit/UIProcess/WebPageInspectorController.h	2018-11-14 23:56:07 UTC (rev 238206)
@@ -50,8 +50,8 @@
 
     bool hasLocalFrontend() const;
 
-    void connectFrontend(Inspector::FrontendChannel*, bool isAutomaticInspection = false, bool immediatelyPause = false);
-    void disconnectFrontend(Inspector::FrontendChannel*);
+    void connectFrontend(Inspector::FrontendChannel&, bool isAutomaticInspection = false, bool immediatelyPause = false);
+    void disconnectFrontend(Inspector::FrontendChannel&);
     void disconnectAllFrontends();
 
     void dispatchMessageFromFrontend(const String& message);

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebInspector.cpp (238205 => 238206)


--- trunk/Source/WebKit/WebProcess/WebPage/WebInspector.cpp	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebInspector.cpp	2018-11-14 23:56:07 UTC (rev 238206)
@@ -145,7 +145,7 @@
     if (!m_frontendConnection)
         return;
 
-    m_page->corePage()->inspectorController().disconnectFrontend(this);
+    m_page->corePage()->inspectorController().disconnectFrontend(*this);
     closeFrontendConnection();
 }
 

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPageInspectorTarget.cpp (238205 => 238206)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPageInspectorTarget.cpp	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPageInspectorTarget.cpp	2018-11-14 23:56:07 UTC (rev 238206)
@@ -47,13 +47,13 @@
 void WebPageInspectorTarget::connect(Inspector::FrontendChannel& channel)
 {
     if (m_page.corePage())
-        m_page.corePage()->inspectorController().connectFrontend(&channel);
+        m_page.corePage()->inspectorController().connectFrontend(channel);
 }
 
 void WebPageInspectorTarget::disconnect(Inspector::FrontendChannel& channel)
 {
     if (m_page.corePage())
-        m_page.corePage()->inspectorController().disconnectFrontend(&channel);
+        m_page.corePage()->inspectorController().disconnectFrontend(channel);
 }
 
 void WebPageInspectorTarget::sendMessageToTargetBackend(const String& message)

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (238205 => 238206)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2018-11-14 23:56:07 UTC (rev 238206)
@@ -1,5 +1,15 @@
 2018-11-14  Joseph Pecoraro  <pecor...@apple.com>
 
+        Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods
+        https://bugs.webkit.org/show_bug.cgi?id=191612
+
+        Reviewed by Matt Baker.
+
+        * WebCoreSupport/WebInspectorClient.mm:
+        (-[WebInspectorWindowController destroyInspectorView]):
+
+2018-11-14  Joseph Pecoraro  <pecor...@apple.com>
+
         Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Remote Inspector)
         https://bugs.webkit.org/show_bug.cgi?id=191494
         <rdar://problem/45469854>

Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm (238205 => 238206)


--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm	2018-11-14 23:56:07 UTC (rev 238206)
@@ -655,7 +655,7 @@
     if (Page* frontendPage = _frontendClient->frontendPage())
         frontendPage->inspectorController().setInspectorFrontendClient(nullptr);
     if (Page* inspectedPage = [_inspectedWebView.get() page])
-        inspectedPage->inspectorController().disconnectFrontend(_inspectorClient);
+        inspectedPage->inspectorController().disconnectFrontend(*_inspectorClient);
 
     [[_inspectedWebView.get() inspector] releaseFrontend];
     _inspectorClient->releaseFrontend();

Modified: trunk/Source/WebKitLegacy/win/ChangeLog (238205 => 238206)


--- trunk/Source/WebKitLegacy/win/ChangeLog	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebKitLegacy/win/ChangeLog	2018-11-14 23:56:07 UTC (rev 238206)
@@ -1,3 +1,13 @@
+2018-11-14  Joseph Pecoraro  <pecor...@apple.com>
+
+        Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods
+        https://bugs.webkit.org/show_bug.cgi?id=191612
+
+        Reviewed by Matt Baker.
+
+        * WebCoreSupport/WebInspectorClient.cpp:
+        (WebInspectorFrontendClient::destroyInspectorView):
+
 2018-11-12  Don Olmstead  <don.olmst...@sony.com>
 
         Shipped PNGs include bad profiles: iCCP: known incorrect sRGB profile

Modified: trunk/Source/WebKitLegacy/win/WebCoreSupport/WebInspectorClient.cpp (238205 => 238206)


--- trunk/Source/WebKitLegacy/win/WebCoreSupport/WebInspectorClient.cpp	2018-11-14 23:40:00 UTC (rev 238205)
+++ trunk/Source/WebKitLegacy/win/WebCoreSupport/WebInspectorClient.cpp	2018-11-14 23:56:07 UTC (rev 238206)
@@ -422,7 +422,7 @@
     if (Page* frontendPage = this->frontendPage())
         frontendPage->inspectorController().setInspectorFrontendClient(nullptr);
     if (Page* inspectedPage = m_inspectedWebView->page())
-        inspectedPage->inspectorController().disconnectFrontend(m_inspectorClient);
+        inspectedPage->inspectorController().disconnectFrontend(*m_inspectorClient);
 
     m_inspectorClient->releaseFrontend();
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to