Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Local...
[WebKit-https.git] / Source / WebKit / UIProcess / WebPageProxy.cpp
index d1d1432..caab5e6 100644 (file)
@@ -800,7 +800,6 @@ void WebPageProxy::finishAttachingToWebProcess(ShouldDelayAttachingDrawingArea s
     updateActivityState();
     updateThrottleState();
 
-    m_inspector = WebInspectorProxy::create(this);
 #if ENABLE(FULLSCREEN_API)
     m_fullScreenManager = std::make_unique<WebFullScreenManagerProxy>(*this, pageClient().fullScreenManagerProxyClient());
 #endif
@@ -823,6 +822,8 @@ void WebPageProxy::finishAttachingToWebProcess(ShouldDelayAttachingDrawingArea s
 
     initializeWebPage(shouldDelayAttachingDrawingArea);
 
+    m_inspector->updateForNewPageProcess(this);
+
 #if ENABLE(REMOTE_INSPECTOR)
     remoteInspectorInformationDidChange();
 #endif
@@ -939,6 +940,9 @@ void WebPageProxy::close()
     m_activeContextMenu = nullptr;
 #endif
 
+    m_inspector->invalidate();
+    m_inspector = nullptr;
+
     m_backForwardList->pageClosed();
     m_inspectorController->pageClosed();
     pageClient().pageClosed();
@@ -6250,10 +6254,7 @@ void WebPageProxy::resetState(ResetStateReason resetStateReason)
     }
     closeOverlayedViews();
 
-    if (m_inspector) {
-        m_inspector->invalidate();
-        m_inspector = nullptr;
-    }
+    m_inspector->reset();
 
 #if ENABLE(FULLSCREEN_API)
     if (m_fullScreenManager) {
@@ -6283,8 +6284,6 @@ void WebPageProxy::resetState(ResetStateReason resetStateReason)
 
     m_toolTip = String();
 
-    m_inspectorHasLocalFrontend = false;
-
     m_mainFrameHasHorizontalScrollbar = false;
     m_mainFrameHasVerticalScrollbar = false;