Web Inspector: REGRESSION(r238378): reloading WebInspector after a settings change...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Nov 2018 17:51:49 +0000 (17:51 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Nov 2018 17:51:49 +0000 (17:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191971

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-11-28
Reviewed by Matt Baker.

* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::reopen): Deleted.
* WebProcess/WebPage/WebInspector.h:
* WebProcess/WebPage/WebInspector.messages.in:
Move reopen out of the WebProcess...

* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::reopen):
* UIProcess/WebInspectorProxy.h:
* UIProcess/WebInspectorProxy.messages.in:
And into the UIProcess where the order of messages won't
be as problematic.

* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::reopen):
Send a message to the WebInspectorProxy instead.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238617 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebInspectorProxy.cpp
Source/WebKit/UIProcess/WebInspectorProxy.h
Source/WebKit/UIProcess/WebInspectorProxy.messages.in
Source/WebKit/WebProcess/WebPage/WebInspector.cpp
Source/WebKit/WebProcess/WebPage/WebInspector.h
Source/WebKit/WebProcess/WebPage/WebInspector.messages.in
Source/WebKit/WebProcess/WebPage/WebInspectorUI.cpp

index 1f23014..f40dd17 100644 (file)
@@ -1,3 +1,27 @@
+2018-11-28  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: REGRESSION(r238378): reloading WebInspector after a settings change doesn't re-show WebInspector
+        https://bugs.webkit.org/show_bug.cgi?id=191971
+
+        Reviewed by Matt Baker.
+
+        * WebProcess/WebPage/WebInspector.cpp:
+        (WebKit::WebInspector::reopen): Deleted.
+        * WebProcess/WebPage/WebInspector.h:
+        * WebProcess/WebPage/WebInspector.messages.in:
+        Move reopen out of the WebProcess...
+
+        * UIProcess/WebInspectorProxy.cpp:
+        (WebKit::WebInspectorProxy::reopen):
+        * UIProcess/WebInspectorProxy.h:
+        * UIProcess/WebInspectorProxy.messages.in:
+        And into the UIProcess where the order of messages won't
+        be as problematic.
+
+        * WebProcess/WebPage/WebInspectorUI.cpp:
+        (WebKit::WebInspectorUI::reopen):
+        Send a message to the WebInspectorProxy instead.
+
 2018-11-28  Alexey Proskuryakov  <ap@apple.com>
 
         Remove another OS version check from NetworkDataTaskCocoa.mm
index 589bbce..bec502b 100644 (file)
@@ -171,6 +171,15 @@ void WebInspectorProxy::closeForCrash()
     platformDidCloseForCrash();
 }
 
+void WebInspectorProxy::reopen()
+{
+    if (!m_inspectedPage)
+        return;
+
+    close();
+    show();
+}
+
 void WebInspectorProxy::reset()
 {
     if (m_inspectedPage) {
@@ -398,6 +407,8 @@ void WebInspectorProxy::openLocalInspectorFrontend(bool canAttach, bool underTes
 
     m_inspectorPage->process().send(Messages::WebInspectorUI::EstablishConnection(m_inspectedPage->pageID(), m_underTest, inspectionLevel()), m_inspectorPage->pageID());
 
+    ASSERT(!m_isActiveFrontend);
+    m_isActiveFrontend = true;
     m_inspectedPage->inspectorController().connectFrontend(*this);
 
     if (!m_underTest) {
@@ -470,7 +481,10 @@ void WebInspectorProxy::closeFrontendPageAndWindow()
     m_inspectorPage->process().send(Messages::WebInspectorUI::SetIsVisible(m_isVisible), m_inspectorPage->pageID());
     m_inspectorPage->process().removeMessageReceiver(Messages::WebInspectorProxy::messageReceiverName(), m_inspectedPage->pageID());
 
-    m_inspectedPage->inspectorController().disconnectFrontend(*this);
+    if (m_isActiveFrontend) {
+        m_isActiveFrontend = false;
+        m_inspectedPage->inspectorController().disconnectFrontend(*this);
+    }
 
     if (m_isAttached)
         platformDetach();
index f8e2f00..7334b4e 100644 (file)
@@ -100,6 +100,7 @@ public:
     void hide();
     void close();
     void closeForCrash();
+    void reopen();
 
     void reset();
     void updateForNewPageProcess(WebPageProxy*);
@@ -254,6 +255,7 @@ private:
     bool m_elementSelectionActive { false };
     bool m_ignoreElementSelectionChange { false };
     bool m_isOpening { false };
+    bool m_isActiveFrontend { false };
 
     AttachmentSide m_attachmentSide {AttachmentSide::Bottom};
 
index 631ff90..4cce0ff 100644 (file)
@@ -29,6 +29,7 @@ messages -> WebInspectorProxy {
     FrontendLoaded()
     DidClose()
     BringToFront()
+    Reopen()
 
     InspectedURLChanged(String urlString)
     ShowCertificate(WebCore::CertificateInfo certificateInfo)
index 3751083..a6f224b 100644 (file)
@@ -142,12 +142,6 @@ void WebInspector::close()
     closeFrontendConnection();
 }
 
-void WebInspector::reopen()
-{
-    close();
-    show();
-}
-
 void WebInspector::openInNewTab(const String& urlString)
 {
     UserGestureIndicator indicator { ProcessingUserGesture };
index 33a11d0..e50396d 100644 (file)
@@ -52,7 +52,6 @@ public:
 
     void show();
     void close();
-    void reopen();
 
     void openInNewTab(const String& urlString);
 
index bcb3f15..bd754c1 100644 (file)
@@ -23,7 +23,6 @@
 messages -> WebInspector {
     Show()
     Close()
-    Reopen()
 
     SetAttached(bool attached)
 
index dbb372c..ef26a01 100644 (file)
@@ -169,8 +169,7 @@ void WebInspectorUI::closeWindow()
 
 void WebInspectorUI::reopen()
 {
-    if (m_backendConnection)
-        m_backendConnection->send(Messages::WebInspector::Reopen(), 0);
+    WebProcess::singleton().parentProcessConnection()->send(Messages::WebInspectorProxy::Reopen(), m_inspectedPageIdentifier);
 }
 
 WebCore::UserInterfaceLayoutDirection WebInspectorUI::userInterfaceLayoutDirection() const