Unreviewed, rolling out r245899.
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 May 2019 23:10:27 +0000 (23:10 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 May 2019 23:10:27 +0000 (23:10 +0000)
Seems to be causing crashes on iosmac

Reverted changeset:

"[iOS] UIProcess' background task expiration handler may get
called after the app is foreground again"
https://bugs.webkit.org/show_bug.cgi?id=198380
https://trac.webkit.org/changeset/245899

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

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/ProcessAssertionIOS.mm

index 8ee8470..7c42b5c 100644 (file)
@@ -1,3 +1,16 @@
+2019-05-31  Chris Dumez  <cdumez@apple.com>
+
+        Unreviewed, rolling out r245899.
+
+        Seems to be causing crashes on iosmac
+
+        Reverted changeset:
+
+        "[iOS] UIProcess' background task expiration handler may get
+        called after the app is foreground again"
+        https://bugs.webkit.org/show_bug.cgi?id=198380
+        https://trac.webkit.org/changeset/245899
+
 2019-05-31  Ryosuke Niwa  <rniwa@webkit.org>
 
         iOS: Main frame should be scrollable when pinch zoomed or software keyboard is up
index 2b9ab03..2aca868 100644 (file)
@@ -150,17 +150,7 @@ static const Seconds releaseBackgroundTaskAfterExpirationDelay { 2_s };
         }
         RELEASE_LOG(ProcessSuspension, "%p - WKProcessAssertionBackgroundTaskManager - beginBackgroundTaskWithName", self);
         _backgroundTask = [[UIApplication sharedApplication] beginBackgroundTaskWithName:@"com.apple.WebKit.ProcessAssertion" expirationHandler:^{
-            RELEASE_LOG_ERROR(ProcessSuspension, "Background task expired while holding WebKit ProcessAssertion (isMainThread? %d, applicationIsBackgrounded? %d).", RunLoop::isMain(), _applicationIsBackgrounded);
-            if (!_applicationIsBackgrounded) {
-                // We've received the invalidation warning after the app has become foreground again. In this case, we should not warn clients of imminent suspension.
-                // To be safe (avoid potential killing), we end the task right away and call _updateBackgroundTask asynchronously to start a new task if necessary.
-                [self _cancelPendingReleaseTask];
-                [self _releaseBackgroundTask];
-                dispatch_async(dispatch_get_main_queue(), ^{
-                    [self _updateBackgroundTask];
-                });
-                return;
-            }
+            RELEASE_LOG_ERROR(ProcessSuspension, "Background task expired while holding WebKit ProcessAssertion (isMainThread? %d).", RunLoop::isMain());
             // The expiration handler gets called on a non-main thread when the underlying assertion could not be taken (rdar://problem/27278419).
             if (RunLoop::isMain())
                 [self _notifyAssertionsOfImminentSuspension];