Title: [240803] trunk/Source/WebKit
Revision
240803
Author
cdu...@apple.com
Date
2019-01-31 11:49:43 -0800 (Thu, 31 Jan 2019)

Log Message

Regression(PSON) Crash under WebProcessProxy::canTerminateChildProcess()
https://bugs.webkit.org/show_bug.cgi?id=194094
<rdar://problem/47580753>

Reviewed by Ryosuke Niwa.

If a SuspendedPageProxy gets destroyed while a WebPageProxy is waiting for its to finish to suspend,
call the "failure to suspend" completion handler asynchronously instead of synchronouly to make sure
the completion handler cannot try and use the suspended page proxy while it is being destroyed.

* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::~SuspendedPageProxy):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (240802 => 240803)


--- trunk/Source/WebKit/ChangeLog	2019-01-31 19:44:15 UTC (rev 240802)
+++ trunk/Source/WebKit/ChangeLog	2019-01-31 19:49:43 UTC (rev 240803)
@@ -1,3 +1,18 @@
+2019-01-31  Chris Dumez  <cdu...@apple.com>
+
+        Regression(PSON) Crash under WebProcessProxy::canTerminateChildProcess()
+        https://bugs.webkit.org/show_bug.cgi?id=194094
+        <rdar://problem/47580753>
+
+        Reviewed by Ryosuke Niwa.
+
+        If a SuspendedPageProxy gets destroyed while a WebPageProxy is waiting for its to finish to suspend,
+        call the "failure to suspend" completion handler asynchronously instead of synchronouly to make sure
+        the completion handler cannot try and use the suspended page proxy while it is being destroyed.
+
+        * UIProcess/SuspendedPageProxy.cpp:
+        (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
+
 2019-01-31  Timothy Hatcher  <timo...@apple.com>
 
         Fix LSAppLink deprecation warnings.

Modified: trunk/Source/WebKit/UIProcess/SuspendedPageProxy.cpp (240802 => 240803)


--- trunk/Source/WebKit/UIProcess/SuspendedPageProxy.cpp	2019-01-31 19:44:15 UTC (rev 240802)
+++ trunk/Source/WebKit/UIProcess/SuspendedPageProxy.cpp	2019-01-31 19:49:43 UTC (rev 240803)
@@ -92,8 +92,11 @@
 
 SuspendedPageProxy::~SuspendedPageProxy()
 {
-    if (m_readyToUnsuspendHandler)
-        m_readyToUnsuspendHandler(nullptr);
+    if (m_readyToUnsuspendHandler) {
+        RunLoop::main().dispatch([readyToUnsuspendHandler = WTFMove(m_readyToUnsuspendHandler)]() mutable {
+            readyToUnsuspendHandler(nullptr);
+        });
+    }
 
     if (m_suspensionState == SuspensionState::Resumed)
         return;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to