Changeset 238206 in webkit


Ignore:
Timestamp:
Nov 14, 2018, 3:56:07 PM (7 years ago)
Author:
Joseph Pecoraro
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/JavaScriptCore:

  • 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):

Location:
trunk/Source
Files:
34 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r238192 r238206  
     12018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods
     4        https://bugs.webkit.org/show_bug.cgi?id=191612
     5
     6        Reviewed by Matt Baker.
     7
     8        * inspector/InspectorFrontendRouter.cpp:
     9        (Inspector::FrontendRouter::connectFrontend):
     10        (Inspector::FrontendRouter::disconnectFrontend):
     11        * inspector/InspectorFrontendRouter.h:
     12        * inspector/JSGlobalObjectInspectorController.cpp:
     13        (Inspector::JSGlobalObjectInspectorController::connectFrontend):
     14        (Inspector::JSGlobalObjectInspectorController::disconnectFrontend):
     15        * inspector/JSGlobalObjectInspectorController.h:
     16        * inspector/remote/RemoteControllableTarget.h:
     17        * inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm:
     18        (Inspector::RemoteConnectionToTarget::setup):
     19        (Inspector::RemoteConnectionToTarget::close):
     20        * inspector/remote/glib/RemoteConnectionToTargetGlib.cpp:
     21        (Inspector::RemoteConnectionToTarget::setup):
     22        (Inspector::RemoteConnectionToTarget::close):
     23        * runtime/JSGlobalObjectDebuggable.cpp:
     24        (JSC::JSGlobalObjectDebuggable::connect):
     25        (JSC::JSGlobalObjectDebuggable::disconnect):
     26        * runtime/JSGlobalObjectDebuggable.h:
     27
    1282018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
    229
  • trunk/Source/JavaScriptCore/inspector/InspectorFrontendRouter.cpp

    r189433 r238206  
    3737}
    3838
    39 void FrontendRouter::connectFrontend(FrontendChannel* connection)
     39void FrontendRouter::connectFrontend(FrontendChannel& connection)
    4040{
    41     ASSERT_ARG(connection, connection);
    42 
    43     if (m_connections.contains(connection)) {
     41    if (m_connections.contains(&connection)) {
    4442        ASSERT_NOT_REACHED();
    4543        return;
    4644    }
    4745
    48     m_connections.append(connection);
     46    m_connections.append(&connection);
    4947}
    5048
    51 void FrontendRouter::disconnectFrontend(FrontendChannel* connection)
     49void FrontendRouter::disconnectFrontend(FrontendChannel& connection)
    5250{
    53     ASSERT_ARG(connection, connection);
    54 
    55     if (!m_connections.contains(connection)) {
     51    if (!m_connections.contains(&connection)) {
    5652        ASSERT_NOT_REACHED();
    5753        return;
    5854    }
    5955
    60     m_connections.removeFirst(connection);
     56    m_connections.removeFirst(&connection);
    6157}
    6258
  • trunk/Source/JavaScriptCore/inspector/InspectorFrontendRouter.h

    r225231 r238206  
    4444    unsigned frontendCount() const { return m_connections.size(); }
    4545
    46     void connectFrontend(FrontendChannel*);
    47     void disconnectFrontend(FrontendChannel*);
     46    void connectFrontend(FrontendChannel&);
     47    void disconnectFrontend(FrontendChannel&);
    4848    void disconnectAllFrontends();
    4949
  • trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp

    r233139 r238206  
    120120}
    121121
    122 void JSGlobalObjectInspectorController::connectFrontend(FrontendChannel* frontendChannel, bool isAutomaticInspection, bool immediatelyPause)
    123 {
    124     ASSERT_ARG(frontendChannel, frontendChannel);
    125 
     122void JSGlobalObjectInspectorController::connectFrontend(FrontendChannel& frontendChannel, bool isAutomaticInspection, bool immediatelyPause)
     123{
    126124    m_isAutomaticInspection = isAutomaticInspection;
    127125    m_pauseAfterInitialization = immediatelyPause;
     
    148146}
    149147
    150 void JSGlobalObjectInspectorController::disconnectFrontend(FrontendChannel* frontendChannel)
    151 {
    152     ASSERT_ARG(frontendChannel, frontendChannel);
    153 
     148void JSGlobalObjectInspectorController::disconnectFrontend(FrontendChannel& frontendChannel)
     149{
    154150    // FIXME: change this to notify agents which frontend has disconnected (by id).
    155151    m_agents.willDestroyFrontendAndBackend(DisconnectReason::InspectorDestroyed);
  • trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h

    r217509 r238206  
    6969    ~JSGlobalObjectInspectorController();
    7070
    71     void connectFrontend(FrontendChannel*, bool isAutomaticInspection, bool immediatelyPause);
    72     void disconnectFrontend(FrontendChannel*);
     71    void connectFrontend(FrontendChannel&, bool isAutomaticInspection, bool immediatelyPause);
     72    void disconnectFrontend(FrontendChannel&);
    7373
    7474    void dispatchMessageFromFrontend(const String&);
  • trunk/Source/JavaScriptCore/inspector/remote/RemoteControllableTarget.h

    r225654 r238206  
    4646    void update();
    4747
    48     virtual void connect(FrontendChannel*, bool isAutomaticConnection = false, bool immediatelyPause = false) = 0;
    49     virtual void disconnect(FrontendChannel*) = 0;
     48    virtual void connect(FrontendChannel&, bool isAutomaticConnection = false, bool immediatelyPause = false) = 0;
     49    virtual void disconnect(FrontendChannel&) = 0;
    5050
    5151    unsigned targetIdentifier() const { return m_identifier; }
  • trunk/Source/JavaScriptCore/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm

    r237266 r238206  
    172172            } else if (is<RemoteInspectionTarget>(m_target)) {
    173173                auto castedTarget = downcast<RemoteInspectionTarget>(m_target);
    174                 castedTarget->connect(this, isAutomaticInspection, automaticallyPause);
     174                castedTarget->connect(*this, isAutomaticInspection, automaticallyPause);
    175175                m_connected = true;
    176176
     
    178178            } else if (is<RemoteAutomationTarget>(m_target)) {
    179179                auto castedTarget = downcast<RemoteAutomationTarget>(m_target);
    180                 castedTarget->connect(this);
     180                castedTarget->connect(*this);
    181181                m_connected = true;
    182182
     
    207207            if (m_target) {
    208208                if (m_connected)
    209                     m_target->disconnect(this);
     209                    m_target->disconnect(*this);
    210210
    211211                m_target = nullptr;
  • trunk/Source/JavaScriptCore/inspector/remote/glib/RemoteConnectionToTargetGlib.cpp

    r217509 r238206  
    5757    } else if (is<RemoteInspectionTarget>(m_target)) {
    5858        auto target = downcast<RemoteInspectionTarget>(m_target);
    59         target->connect(this, isAutomaticInspection, automaticallyPause);
     59        target->connect(*this, isAutomaticInspection, automaticallyPause);
    6060        m_connected = true;
    6161
     
    6363    } else if (is<RemoteAutomationTarget>(m_target)) {
    6464        auto target = downcast<RemoteAutomationTarget>(m_target);
    65         target->connect(this);
     65        target->connect(*this);
    6666        m_connected = true;
    6767
     
    9494
    9595    if (m_connected)
    96         m_target->disconnect(this);
     96        m_target->disconnect(*this);
    9797
    9898    m_target = nullptr;
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObjectDebuggable.cpp

    r233122 r238206  
    5151}
    5252
    53 void JSGlobalObjectDebuggable::connect(FrontendChannel* frontendChannel, bool automaticInspection, bool immediatelyPause)
     53void JSGlobalObjectDebuggable::connect(FrontendChannel& frontendChannel, bool automaticInspection, bool immediatelyPause)
    5454{
    5555    JSLockHolder locker(&m_globalObject.vm());
     
    5858}
    5959
    60 void JSGlobalObjectDebuggable::disconnect(FrontendChannel* frontendChannel)
     60void JSGlobalObjectDebuggable::disconnect(FrontendChannel& frontendChannel)
    6161{
    6262    JSLockHolder locker(&m_globalObject.vm());
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObjectDebuggable.h

    r225654 r238206  
    5252    bool hasLocalDebugger() const final { return false; }
    5353
    54     void connect(Inspector::FrontendChannel*, bool isAutomaticConnection = false, bool immediatelyPause = false) final;
    55     void disconnect(Inspector::FrontendChannel*) final;
     54    void connect(Inspector::FrontendChannel&, bool isAutomaticConnection = false, bool immediatelyPause = false) final;
     55    void disconnect(Inspector::FrontendChannel&) final;
    5656    void dispatchMessageFromRemote(const String& message) final;
    5757
  • trunk/Source/WebCore/ChangeLog

    r238200 r238206  
     12018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods
     4        https://bugs.webkit.org/show_bug.cgi?id=191612
     5
     6        Reviewed by Matt Baker.
     7
     8        * inspector/InspectorController.cpp:
     9        (WebCore::InspectorController::connectFrontend):
     10        (WebCore::InspectorController::disconnectFrontend):
     11        (WebCore::InspectorController::show):
     12        * inspector/InspectorController.h:
     13        * inspector/WorkerInspectorController.cpp:
     14        (WebCore::WorkerInspectorController::connectFrontend):
     15        (WebCore::WorkerInspectorController::disconnectFrontend):
     16        * page/PageDebuggable.cpp:
     17        (WebCore::PageDebuggable::connect):
     18        (WebCore::PageDebuggable::disconnect):
     19        * page/PageDebuggable.h:
     20        * testing/Internals.cpp:
     21        (WebCore::InspectorStubFrontend::InspectorStubFrontend):
     22        (WebCore::InspectorStubFrontend::closeWindow):
     23        * workers/service/context/ServiceWorkerDebuggable.cpp:
     24        (WebCore::ServiceWorkerDebuggable::connect):
     25        (WebCore::ServiceWorkerDebuggable::disconnect):
     26        * workers/service/context/ServiceWorkerDebuggable.h:
     27        * workers/service/context/ServiceWorkerInspectorProxy.cpp:
     28        (WebCore::ServiceWorkerInspectorProxy::connectToWorker):
     29        (WebCore::ServiceWorkerInspectorProxy::disconnectFromWorker):
     30        * workers/service/context/ServiceWorkerInspectorProxy.h:
     31
    1322018-11-14  Timothy Hatcher  <timothy@apple.com>
    233
  • trunk/Source/WebCore/inspector/InspectorController.cpp

    r238192 r238206  
    255255}
    256256
    257 void InspectorController::connectFrontend(Inspector::FrontendChannel* frontendChannel, bool isAutomaticInspection, bool immediatelyPause)
    258 {
    259     ASSERT_ARG(frontendChannel, frontendChannel);
     257void InspectorController::connectFrontend(Inspector::FrontendChannel& frontendChannel, bool isAutomaticInspection, bool immediatelyPause)
     258{
    260259    ASSERT(m_inspectorClient);
    261260
     
    286285}
    287286
    288 void InspectorController::disconnectFrontend(FrontendChannel* frontendChannel)
     287void InspectorController::disconnectFrontend(FrontendChannel& frontendChannel)
    289288{
    290289    m_frontendRouter->disconnectFrontend(frontendChannel);
     
    363362        m_inspectorClient->bringFrontendToFront();
    364363    else if (Inspector::FrontendChannel* frontendChannel = m_inspectorClient->openLocalFrontend(this))
    365         connectFrontend(frontendChannel);
     364        connectFrontend(*frontendChannel);
    366365}
    367366
  • trunk/Source/WebCore/inspector/InspectorController.h

    r238192 r238206  
    9292    bool hasRemoteFrontend() const;
    9393
    94     WEBCORE_EXPORT void connectFrontend(Inspector::FrontendChannel*, bool isAutomaticInspection = false, bool immediatelyPause = false);
    95     WEBCORE_EXPORT void disconnectFrontend(Inspector::FrontendChannel*);
     94    WEBCORE_EXPORT void connectFrontend(Inspector::FrontendChannel&, bool isAutomaticInspection = false, bool immediatelyPause = false);
     95    WEBCORE_EXPORT void disconnectFrontend(Inspector::FrontendChannel&);
    9696    WEBCORE_EXPORT void disconnectAllFrontends();
    9797
  • trunk/Source/WebCore/inspector/WorkerInspectorController.cpp

    r237997 r238206  
    115115
    116116    m_forwardingChannel = std::make_unique<WorkerToPageFrontendChannel>(m_workerGlobalScope);
    117     m_frontendRouter->connectFrontend(m_forwardingChannel.get());
     117    m_frontendRouter->connectFrontend(*m_forwardingChannel.get());
    118118    m_agents.didCreateFrontendAndBackend(&m_frontendRouter.get(), &m_backendDispatcher.get());
    119119}
     
    131131
    132132    m_agents.willDestroyFrontendAndBackend(reason);
    133     m_frontendRouter->disconnectFrontend(m_forwardingChannel.get());
     133    m_frontendRouter->disconnectFrontend(*m_forwardingChannel.get());
    134134    m_forwardingChannel = nullptr;
    135135}
  • trunk/Source/WebCore/page/PageDebuggable.cpp

    r238192 r238206  
    7070}
    7171
    72 void PageDebuggable::connect(Inspector::FrontendChannel* channel, bool isAutomaticConnection, bool immediatelyPause)
     72void PageDebuggable::connect(FrontendChannel& channel, bool isAutomaticConnection, bool immediatelyPause)
    7373{
    74     InspectorController& inspectorController = m_page.inspectorController();
    75     inspectorController.connectFrontend(channel, isAutomaticConnection, immediatelyPause);
     74    m_page.inspectorController().connectFrontend(channel, isAutomaticConnection, immediatelyPause);
    7675}
    7776
    78 void PageDebuggable::disconnect(Inspector::FrontendChannel* channel)
     77void PageDebuggable::disconnect(FrontendChannel& channel)
    7978{
    80     InspectorController& inspectorController = m_page.inspectorController();
    81     inspectorController.disconnectFrontend(channel);
     79    m_page.inspectorController().disconnectFrontend(channel);
    8280}
    8381
  • trunk/Source/WebCore/page/PageDebuggable.h

    r238192 r238206  
    4848    bool hasLocalDebugger() const final;
    4949
    50     void connect(Inspector::FrontendChannel*, bool isAutomaticConnection = false, bool immediatelyPause = false) final;
    51     void disconnect(Inspector::FrontendChannel*) final;
     50    void connect(Inspector::FrontendChannel&, bool isAutomaticConnection = false, bool immediatelyPause = false) final;
     51    void disconnect(Inspector::FrontendChannel&) final;
    5252    void dispatchMessageFromRemote(const String& message) final;
    5353    void setIndicating(bool) final;
  • trunk/Source/WebCore/testing/Internals.cpp

    r238155 r238206  
    336336
    337337    m_frontendController.setInspectorFrontendClient(this);
    338     inspectedPage.inspectorController().connectFrontend(this);
     338    inspectedPage.inspectorController().connectFrontend(*this);
    339339}
    340340
     
    350350
    351351    m_frontendController.setInspectorFrontendClient(nullptr);
    352     inspectedPage()->inspectorController().disconnectFrontend(this);
     352    inspectedPage()->inspectorController().disconnectFrontend(*this);
    353353
    354354    m_frontendWindow->close();
  • trunk/Source/WebCore/workers/service/context/ServiceWorkerDebuggable.cpp

    r225633 r238206  
    4343}
    4444
    45 void ServiceWorkerDebuggable::connect(Inspector::FrontendChannel* channel, bool, bool)
     45void ServiceWorkerDebuggable::connect(FrontendChannel& channel, bool, bool)
    4646{
    4747    m_serviceWorkerThreadProxy.inspectorProxy().connectToWorker(channel);
    4848}
    4949
    50 void ServiceWorkerDebuggable::disconnect(Inspector::FrontendChannel* channel)
     50void ServiceWorkerDebuggable::disconnect(FrontendChannel& channel)
    5151{
    5252    m_serviceWorkerThreadProxy.inspectorProxy().disconnectFromWorker(channel);
  • trunk/Source/WebCore/workers/service/context/ServiceWorkerDebuggable.h

    r233122 r238206  
    5050    bool hasLocalDebugger() const final { return false; }
    5151
    52     void connect(Inspector::FrontendChannel*, bool isAutomaticConnection = false, bool immediatelyPause = false) final;
    53     void disconnect(Inspector::FrontendChannel*) final;
     52    void connect(Inspector::FrontendChannel&, bool isAutomaticConnection = false, bool immediatelyPause = false) final;
     53    void disconnect(Inspector::FrontendChannel&) final;
    5454    void dispatchMessageFromRemote(const String& message) final;
    5555
  • trunk/Source/WebCore/workers/service/context/ServiceWorkerInspectorProxy.cpp

    r228218 r238206  
    5858}
    5959
    60 void ServiceWorkerInspectorProxy::connectToWorker(FrontendChannel* channel)
     60void ServiceWorkerInspectorProxy::connectToWorker(FrontendChannel& channel)
    6161{
    62     m_channel = channel;
     62    m_channel = &channel;
    6363
    6464    m_serviceWorkerThreadProxy.thread().runLoop().postTaskForMode([] (ScriptExecutionContext& context) {
     
    6767}
    6868
    69 void ServiceWorkerInspectorProxy::disconnectFromWorker(FrontendChannel* channel)
     69void ServiceWorkerInspectorProxy::disconnectFromWorker(FrontendChannel& channel)
    7070{
    71     ASSERT_UNUSED(channel, channel == m_channel);
     71    ASSERT_UNUSED(channel, &channel == m_channel);
    7272    m_channel = nullptr;
    7373
  • trunk/Source/WebCore/workers/service/context/ServiceWorkerInspectorProxy.h

    r224368 r238206  
    5050    void serviceWorkerTerminated();
    5151
    52     void connectToWorker(Inspector::FrontendChannel*);
    53     void disconnectFromWorker(Inspector::FrontendChannel*);
     52    void connectToWorker(Inspector::FrontendChannel&);
     53    void disconnectFromWorker(Inspector::FrontendChannel&);
    5454    void sendMessageToWorker(const String&);
    5555    void sendMessageFromWorkerToFrontend(const String&);
  • trunk/Source/WebKit/ChangeLog

    r238195 r238206  
     12018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods
     4        https://bugs.webkit.org/show_bug.cgi?id=191612
     5
     6        Reviewed by Matt Baker.
     7
     8        * UIProcess/Automation/WebAutomationSession.cpp:
     9        (WebKit::WebAutomationSession::connect):
     10        (WebKit::WebAutomationSession::disconnect):
     11        (WebKit::WebAutomationSession::terminate):
     12        * UIProcess/Automation/WebAutomationSession.h:
     13        * UIProcess/WebPageDebuggable.cpp:
     14        (WebKit::WebPageDebuggable::connect):
     15        (WebKit::WebPageDebuggable::disconnect):
     16        * UIProcess/WebPageDebuggable.h:
     17        * UIProcess/WebPageInspectorController.cpp:
     18        (WebKit::WebPageInspectorController::connectFrontend):
     19        (WebKit::WebPageInspectorController::disconnectFrontend):
     20        * UIProcess/WebPageInspectorController.h:
     21        * WebProcess/WebPage/WebInspector.cpp:
     22        (WebKit::WebInspector::close):
     23        * WebProcess/WebPage/WebPageInspectorTarget.cpp:
     24        (WebKit::WebPageInspectorTarget::connect):
     25        (WebKit::WebPageInspectorTarget::disconnect):
     26
    1272018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
    228
  • trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp

    r236939 r238206  
    119119}
    120120
    121 void WebAutomationSession::connect(Inspector::FrontendChannel* channel, bool isAutomaticConnection, bool immediatelyPause)
     121void WebAutomationSession::connect(Inspector::FrontendChannel& channel, bool isAutomaticConnection, bool immediatelyPause)
    122122{
    123123    UNUSED_PARAM(isAutomaticConnection);
    124124    UNUSED_PARAM(immediatelyPause);
    125125
    126     m_remoteChannel = channel;
     126    m_remoteChannel = &channel;
    127127    m_frontendRouter->connectFrontend(channel);
    128128
     
    130130}
    131131
    132 void WebAutomationSession::disconnect(Inspector::FrontendChannel* channel)
    133 {
    134     ASSERT(channel == m_remoteChannel);
     132void WebAutomationSession::disconnect(Inspector::FrontendChannel& channel)
     133{
     134    ASSERT(&channel == m_remoteChannel);
    135135    terminate();
    136136}
     
    153153    if (Inspector::FrontendChannel* channel = m_remoteChannel) {
    154154        m_remoteChannel = nullptr;
    155         m_frontendRouter->disconnectFrontend(channel);
     155        m_frontendRouter->disconnectFrontend(*channel);
    156156    }
    157157
  • trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.h

    r233131 r238206  
    131131    String name() const override { return m_sessionIdentifier; }
    132132    void dispatchMessageFromRemote(const String& message) override;
    133     void connect(Inspector::FrontendChannel*, bool isAutomaticConnection = false, bool immediatelyPause = false) override;
    134     void disconnect(Inspector::FrontendChannel*) override;
     133    void connect(Inspector::FrontendChannel&, bool isAutomaticConnection = false, bool immediatelyPause = false) override;
     134    void disconnect(Inspector::FrontendChannel&) override;
    135135#endif
    136136    void terminate();
  • trunk/Source/WebKit/UIProcess/WebPageDebuggable.cpp

    r238192 r238206  
    6767}
    6868
    69 void WebPageDebuggable::connect(Inspector::FrontendChannel* channel, bool isAutomaticConnection, bool immediatelyPause)
     69void WebPageDebuggable::connect(FrontendChannel& channel, bool isAutomaticConnection, bool immediatelyPause)
    7070{
    7171    m_page.inspectorController().connectFrontend(channel, isAutomaticConnection, immediatelyPause);
    7272}
    7373
    74 void WebPageDebuggable::disconnect(Inspector::FrontendChannel* channel)
     74void WebPageDebuggable::disconnect(FrontendChannel& channel)
    7575{
    7676    m_page.inspectorController().disconnectFrontend(channel);
  • trunk/Source/WebKit/UIProcess/WebPageDebuggable.h

    r238192 r238206  
    4848    bool hasLocalDebugger() const final;
    4949
    50     void connect(Inspector::FrontendChannel*, bool isAutomaticConnection = false, bool immediatelyPause = false) final;
    51     void disconnect(Inspector::FrontendChannel*) final;
     50    void connect(Inspector::FrontendChannel&, bool isAutomaticConnection = false, bool immediatelyPause = false) final;
     51    void disconnect(Inspector::FrontendChannel&) final;
    5252    void dispatchMessageFromRemote(const String& message) final;
    5353    void setIndicating(bool) final;
  • trunk/Source/WebKit/UIProcess/WebPageInspectorController.cpp

    r238192 r238206  
    6363}
    6464
    65 void WebPageInspectorController::connectFrontend(Inspector::FrontendChannel* frontendChannel, bool, bool)
     65void WebPageInspectorController::connectFrontend(Inspector::FrontendChannel& frontendChannel, bool, bool)
    6666{
    67     ASSERT_ARG(frontendChannel, frontendChannel);
    68 
    6967    bool connectingFirstFrontend = !m_frontendRouter->hasFrontends();
    7068
     
    8280}
    8381
    84 void WebPageInspectorController::disconnectFrontend(FrontendChannel* frontendChannel)
     82void WebPageInspectorController::disconnectFrontend(FrontendChannel& frontendChannel)
    8583{
    8684    m_frontendRouter->disconnectFrontend(frontendChannel);
  • trunk/Source/WebKit/UIProcess/WebPageInspectorController.h

    r238192 r238206  
    5151    bool hasLocalFrontend() const;
    5252
    53     void connectFrontend(Inspector::FrontendChannel*, bool isAutomaticInspection = false, bool immediatelyPause = false);
    54     void disconnectFrontend(Inspector::FrontendChannel*);
     53    void connectFrontend(Inspector::FrontendChannel&, bool isAutomaticInspection = false, bool immediatelyPause = false);
     54    void disconnectFrontend(Inspector::FrontendChannel&);
    5555    void disconnectAllFrontends();
    5656
  • trunk/Source/WebKit/WebProcess/WebPage/WebInspector.cpp

    r238193 r238206  
    146146        return;
    147147
    148     m_page->corePage()->inspectorController().disconnectFrontend(this);
     148    m_page->corePage()->inspectorController().disconnectFrontend(*this);
    149149    closeFrontendConnection();
    150150}
  • trunk/Source/WebKit/WebProcess/WebPage/WebPageInspectorTarget.cpp

    r238192 r238206  
    4848{
    4949    if (m_page.corePage())
    50         m_page.corePage()->inspectorController().connectFrontend(&channel);
     50        m_page.corePage()->inspectorController().connectFrontend(channel);
    5151}
    5252
     
    5454{
    5555    if (m_page.corePage())
    56         m_page.corePage()->inspectorController().disconnectFrontend(&channel);
     56        m_page.corePage()->inspectorController().disconnectFrontend(channel);
    5757}
    5858
  • trunk/Source/WebKitLegacy/mac/ChangeLog

    r238192 r238206  
     12018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods
     4        https://bugs.webkit.org/show_bug.cgi?id=191612
     5
     6        Reviewed by Matt Baker.
     7
     8        * WebCoreSupport/WebInspectorClient.mm:
     9        (-[WebInspectorWindowController destroyInspectorView]):
     10
    1112018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
    212
  • trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm

    r230211 r238206  
    656656        frontendPage->inspectorController().setInspectorFrontendClient(nullptr);
    657657    if (Page* inspectedPage = [_inspectedWebView.get() page])
    658         inspectedPage->inspectorController().disconnectFrontend(_inspectorClient);
     658        inspectedPage->inspectorController().disconnectFrontend(*_inspectorClient);
    659659
    660660    [[_inspectedWebView.get() inspector] releaseFrontend];
  • trunk/Source/WebKitLegacy/win/ChangeLog

    r238106 r238206  
     12018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods
     4        https://bugs.webkit.org/show_bug.cgi?id=191612
     5
     6        Reviewed by Matt Baker.
     7
     8        * WebCoreSupport/WebInspectorClient.cpp:
     9        (WebInspectorFrontendClient::destroyInspectorView):
     10
    1112018-11-12  Don Olmstead  <don.olmstead@sony.com>
    212
  • trunk/Source/WebKitLegacy/win/WebCoreSupport/WebInspectorClient.cpp

    r235938 r238206  
    423423        frontendPage->inspectorController().setInspectorFrontendClient(nullptr);
    424424    if (Page* inspectedPage = m_inspectedWebView->page())
    425         inspectedPage->inspectorController().disconnectFrontend(m_inspectorClient);
     425        inspectedPage->inspectorController().disconnectFrontend(*m_inspectorClient);
    426426
    427427    m_inspectorClient->releaseFrontend();
Note: See TracChangeset for help on using the changeset viewer.