Title: [287786] trunk/Source/WebKit
Revision
287786
Author
pan...@apple.com
Date
2022-01-07 14:46:50 -0800 (Fri, 07 Jan 2022)

Log Message

REGRESSION(r286498): Web Inspector: Inspector^2 fails to load in release builds and crashes with an assertion in debug builds
https://bugs.webkit.org/show_bug.cgi?id=234968

Reviewed by Devin Rousso.

Inspector^2 would fail to open a local inspector frontend because m_inspectedPageIdentifier was not set before
it was used in `WebInspectorUIProxy::createFrontendPage`. To correct this, we now cache the inspected page
identifier immediately upon creating the WebInspectorUIProxy, instead of only in
`WebInspectorUIProxy::updateForNewPageProcess`. This also allows us to use the cached identifier in
`WebInspectorUIProxy::openLocalInspectorFrontend` as discussed in <http://webkit.org/b/233293#c5>.

* UIProcess/Inspector/WebInspectorUIProxy.cpp:
(WebKit::WebInspectorUIProxy::WebInspectorUIProxy):
(WebKit::WebInspectorUIProxy::openLocalInspectorFrontend):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (287785 => 287786)


--- trunk/Source/WebKit/ChangeLog	2022-01-07 22:46:16 UTC (rev 287785)
+++ trunk/Source/WebKit/ChangeLog	2022-01-07 22:46:50 UTC (rev 287786)
@@ -1,3 +1,20 @@
+2022-01-07  Patrick Angle  <pan...@apple.com>
+
+        REGRESSION(r286498): Web Inspector: Inspector^2 fails to load in release builds and crashes with an assertion in debug builds
+        https://bugs.webkit.org/show_bug.cgi?id=234968
+
+        Reviewed by Devin Rousso.
+
+        Inspector^2 would fail to open a local inspector frontend because m_inspectedPageIdentifier was not set before
+        it was used in `WebInspectorUIProxy::createFrontendPage`. To correct this, we now cache the inspected page
+        identifier immediately upon creating the WebInspectorUIProxy, instead of only in
+        `WebInspectorUIProxy::updateForNewPageProcess`. This also allows us to use the cached identifier in
+        `WebInspectorUIProxy::openLocalInspectorFrontend` as discussed in <http://webkit.org/b/233293#c5>.
+
+        * UIProcess/Inspector/WebInspectorUIProxy.cpp:
+        (WebKit::WebInspectorUIProxy::WebInspectorUIProxy):
+        (WebKit::WebInspectorUIProxy::openLocalInspectorFrontend):
+
 2022-01-07  Said Abou-Hallawa  <s...@apple.com>
 
         [GPU Process] Remove the result FilterImage from FilterEffect

Modified: trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp (287785 => 287786)


--- trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp	2022-01-07 22:46:16 UTC (rev 287785)
+++ trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp	2022-01-07 22:46:50 UTC (rev 287786)
@@ -67,6 +67,7 @@
 WebInspectorUIProxy::WebInspectorUIProxy(WebPageProxy& inspectedPage)
     : m_inspectedPage(&inspectedPage)
     , m_inspectorClient(makeUnique<API::InspectorClient>())
+    , m_inspectedPageIdentifier(inspectedPage.identifier())
 #if PLATFORM(MAC)
     , m_closeFrontendAfterInactivityTimer(RunLoop::main(), this, &WebInspectorUIProxy::closeFrontendAfterInactivityTimerFired)
 #endif
@@ -448,7 +449,7 @@
     if (!m_inspectorPage)
         return;
 
-    m_inspectorPage->send(Messages::WebInspectorUI::EstablishConnection(m_inspectedPage->identifier(), infoForLocalDebuggable(), m_underTest, inspectionLevel()));
+    m_inspectorPage->send(Messages::WebInspectorUI::EstablishConnection(m_inspectedPageIdentifier, infoForLocalDebuggable(), m_underTest, inspectionLevel()));
 
     ASSERT(!m_isActiveFrontend);
     m_isActiveFrontend = true;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to