Title: [251627] trunk/Source/WebKit
Revision
251627
Author
cdu...@apple.com
Date
2019-10-25 21:53:33 -0700 (Fri, 25 Oct 2019)

Log Message

REGRESSION(r251599): Crash in MobileSafari tests (ASSERTION FAILED: m_pendingRequestToSuspendID)
https://bugs.webkit.org/show_bug.cgi?id=203437
<rdar://problem/56633399>

Reviewed by Geoffrey Garen.

* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::updateAssertionIfNeeded):
Start the timer before sending the PrepareToSuspend IPC. The reason is that if the process has been
terminated, the completion handler may run synchronously and cancel the request to suspend / stop
the timer. Therefore, re-starting the timer after would be a mistake.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (251626 => 251627)


--- trunk/Source/WebKit/ChangeLog	2019-10-26 02:38:39 UTC (rev 251626)
+++ trunk/Source/WebKit/ChangeLog	2019-10-26 04:53:33 UTC (rev 251627)
@@ -1,3 +1,17 @@
+2019-10-25  Chris Dumez  <cdu...@apple.com>
+
+        REGRESSION(r251599): Crash in MobileSafari tests (ASSERTION FAILED: m_pendingRequestToSuspendID)
+        https://bugs.webkit.org/show_bug.cgi?id=203437
+        <rdar://problem/56633399>
+
+        Reviewed by Geoffrey Garen.
+
+        * UIProcess/ProcessThrottler.cpp:
+        (WebKit::ProcessThrottler::updateAssertionIfNeeded):
+        Start the timer before sending the PrepareToSuspend IPC. The reason is that if the process has been
+        terminated, the completion handler may run synchronously and cancel the request to suspend / stop
+        the timer. Therefore, re-starting the timer after would be a mistake.
+
 2019-10-25  David Kilzer  <ddkil...@apple.com>
 
         Unused arguments in MESSAGE_CHECK_CONTEXTID() macros

Modified: trunk/Source/WebKit/UIProcess/ProcessThrottler.cpp (251626 => 251627)


--- trunk/Source/WebKit/UIProcess/ProcessThrottler.cpp	2019-10-26 02:38:39 UTC (rev 251626)
+++ trunk/Source/WebKit/UIProcess/ProcessThrottler.cpp	2019-10-26 04:53:33 UTC (rev 251627)
@@ -92,8 +92,8 @@
         // and clean up - move it to the background and send it a message to notify. Schedule a timeout so it can't stay running
         // in the background for too long.
         if (m_assertion->state() != AssertionState::Suspended) {
+            m_prepareToSuspendTimeoutTimer.startOneShot(processSuspensionTimeout);
             sendPrepareToSuspendIPC(IsSuspensionImminent::No);
-            m_prepareToSuspendTimeoutTimer.startOneShot(processSuspensionTimeout);
             return;
         }
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to