[iOS] Web Inspector: Occasional UIProcess crashes under WebPageProxy::showInspectorIn...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Dec 2018 04:09:59 +0000 (04:09 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Dec 2018 04:09:59 +0000 (04:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192689
<rdar://problem/46323610>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-12-13
Reviewed by Simon Fraser.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
* UIProcess/WebPageProxy.h:
Don't wait until ~WebPageProxy to destroy the WebPageProxyDebuggable
which broadcasts it as a remote inspector target. Terminate this
as soon as the WebPageProxy closes and becomes invalid.

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

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h

index cacb511..e1ba519 100644 (file)
@@ -1,3 +1,18 @@
+2018-12-13  Joseph Pecoraro  <pecoraro@apple.com>
+
+        [iOS] Web Inspector: Occasional UIProcess crashes under WebPageProxy::showInspectorIndication
+        https://bugs.webkit.org/show_bug.cgi?id=192689
+        <rdar://problem/46323610>
+
+        Reviewed by Simon Fraser.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::close):
+        * UIProcess/WebPageProxy.h:
+        Don't wait until ~WebPageProxy to destroy the WebPageProxyDebuggable
+        which broadcasts it as a remote inspector target. Terminate this
+        as soon as the WebPageProxy closes and becomes invalid.
+
 2018-12-13  Chris Dumez  <cdumez@apple.com>
 
         Unreviewed build fix for tvOS.
 2018-12-13  Chris Dumez  <cdumez@apple.com>
 
         Unreviewed build fix for tvOS.
index 358db6f..04b038e 100644 (file)
@@ -958,6 +958,9 @@ void WebPageProxy::close()
 
     m_backForwardList->pageClosed();
     m_inspectorController->pageClosed();
 
     m_backForwardList->pageClosed();
     m_inspectorController->pageClosed();
+#if ENABLE(REMOTE_INSPECTOR)
+    m_inspectorDebuggable = nullptr;
+#endif
     pageClient().pageClosed();
 
     m_process->disconnectFramesFromPage(this);
     pageClient().pageClosed();
 
     m_process->disconnectFramesFromPage(this);
index 3dfd653..d96473e 100644 (file)
@@ -2295,7 +2295,7 @@ private:
 
     const std::unique_ptr<WebPageInspectorController> m_inspectorController;
 #if ENABLE(REMOTE_INSPECTOR)
 
     const std::unique_ptr<WebPageInspectorController> m_inspectorController;
 #if ENABLE(REMOTE_INSPECTOR)
-    const std::unique_ptr<WebPageDebuggable> m_inspectorDebuggable;
+    std::unique_ptr<WebPageDebuggable> m_inspectorDebuggable;
 #endif
 
     std::optional<SpellDocumentTag> m_spellDocumentTag;
 #endif
 
     std::optional<SpellDocumentTag> m_spellDocumentTag;