Web Inspector: Follow-up: Keep Disabling Process Swap for Local Web Inspector
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Nov 2018 21:03:53 +0000 (21:03 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Nov 2018 21:03:53 +0000 (21:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191494
<rdar://problem/45469854>

Reviewed by Devin Rousso.

Continue to have the Local Inspector disable PSON while open
until support is added.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetState):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::hasLocalInspectorFrontend const):
(WebKit::WebPageProxy::setHasLocalInspectorFrontend):
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::openFrontendConnection):
(WebKit::WebInspector::closeFrontendConnection):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setHasLocalInspectorFrontend):
* WebProcess/WebPage/WebPage.h:

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

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/WebPageProxy.messages.in
Source/WebKit/UIProcess/WebProcessPool.cpp
Source/WebKit/WebProcess/WebPage/WebInspector.cpp
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebPage/WebPage.h

index c95c7c6..0d396d5 100644 (file)
@@ -1,5 +1,31 @@
 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
 
+        Web Inspector: Follow-up: Keep Disabling Process Swap for Local Web Inspector
+        https://bugs.webkit.org/show_bug.cgi?id=191494
+        <rdar://problem/45469854>
+
+        Reviewed by Devin Rousso.
+
+        Continue to have the Local Inspector disable PSON while open
+        until support is added.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::resetState):
+        * UIProcess/WebPageProxy.h:
+        (WebKit::WebPageProxy::hasLocalInspectorFrontend const):
+        (WebKit::WebPageProxy::setHasLocalInspectorFrontend):
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::processForNavigationInternal):
+        * WebProcess/WebPage/WebInspector.cpp:
+        (WebKit::WebInspector::openFrontendConnection):
+        (WebKit::WebInspector::closeFrontendConnection):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::setHasLocalInspectorFrontend):
+        * WebProcess/WebPage/WebPage.h:
+
+2018-11-14  Joseph Pecoraro  <pecoraro@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>
index 5dbf4a0..a1cbdec 100644 (file)
@@ -6283,6 +6283,8 @@ void WebPageProxy::resetState(ResetStateReason resetStateReason)
 
     m_toolTip = String();
 
+    m_inspectorHasLocalFrontend = false;
+
     m_mainFrameHasHorizontalScrollbar = false;
     m_mainFrameHasVerticalScrollbar = false;
 
index 56dfacf..78b5927 100644 (file)
@@ -380,6 +380,9 @@ public:
 
     WebInspectorProxy* inspector() const;
 
+    bool hasLocalInspectorFrontend() const { return m_inspectorHasLocalFrontend; }
+    void setHasLocalInspectorFrontend(bool hasLocalFrontend) { m_inspectorHasLocalFrontend = hasLocalFrontend; }
+
     void didChangeInspectorFrontendCount(unsigned count) { m_inspectorFrontendCount = count; }
     unsigned inspectorFrontendCount() const { return m_inspectorFrontendCount; }
 
@@ -2114,6 +2117,7 @@ private:
     bool m_controlledByAutomation { false };
 
     unsigned m_inspectorFrontendCount { 0 };
+    bool m_inspectorHasLocalFrontend { false };
 
 #if PLATFORM(COCOA)
     bool m_isSmartInsertDeleteEnabled { false };
index 81918fb..690d354 100644 (file)
@@ -419,6 +419,7 @@ messages -> WebPageProxy {
     DisableInspectorNodeSearch()
 #endif
 
+    SetHasLocalInspectorFrontend(bool hasLocalFrontend)
     DidChangeInspectorFrontendCount(uint64_t count)
 
     CreateInspectorTarget(String targetId, enum:uint8_t Inspector::InspectorTargetType type)
index 889dab4..c82afcf 100644 (file)
@@ -2117,6 +2117,12 @@ Ref<WebProcessProxy> WebProcessPool::processForNavigationInternal(WebPageProxy&
         return page.process();
     }
 
+    // FIXME: We should support process swap with a local web inspector.
+    if (page.hasLocalInspectorFrontend()) {
+        reason = "A Local Web Inspector frontend is connected"_s;
+        return page.process();
+    }
+
     if (m_automationSession) {
         reason = "An automation session is active"_s;
         return page.process();
index b2721a5..b32737a 100644 (file)
@@ -100,12 +100,16 @@ void WebInspector::openFrontendConnection(bool underTest)
     m_frontendConnection = IPC::Connection::createServerConnection(connectionIdentifier, *this);
     m_frontendConnection->open();
 
+    m_page->setHasLocalInspectorFrontend(true);
+
     WebProcess::singleton().parentProcessConnection()->send(Messages::WebInspectorProxy::CreateInspectorPage(connectionClientPort, canAttachWindow(), underTest), m_page->pageID());
 #endif
 }
 
 void WebInspector::closeFrontendConnection()
 {
+    m_page->setHasLocalInspectorFrontend(false);
+
     WebProcess::singleton().parentProcessConnection()->send(Messages::WebInspectorProxy::DidClose(), m_page->pageID());
 
     // If we tried to close the frontend before it was created, then no connection exists yet.
index ca6ddb7..8af4eb0 100644 (file)
@@ -3487,6 +3487,11 @@ RemoteWebInspectorUI* WebPage::remoteInspectorUI()
     return m_remoteInspectorUI.get();
 }
 
+void WebPage::setHasLocalInspectorFrontend(bool hasLocalFrontend)
+{
+    send(Messages::WebPageProxy::SetHasLocalInspectorFrontend(hasLocalFrontend));
+}
+
 void WebPage::inspectorFrontendCountChanged(unsigned count)
 {
     send(Messages::WebPageProxy::DidChangeInspectorFrontendCount(count));
index 08031e5..c695278 100644 (file)
@@ -299,6 +299,7 @@ public:
     RemoteWebInspectorUI* remoteInspectorUI();
     bool isInspectorPage() { return !!m_inspectorUI || !!m_remoteInspectorUI; }
 
+    void setHasLocalInspectorFrontend(bool);
     void inspectorFrontendCountChanged(unsigned);
 
 #if PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))