Title: [221145] branches/safari-604.1.38.0-branch/Source/WebKit
Revision
221145
Author
jmarc...@apple.com
Date
2017-08-24 10:31:56 -0700 (Thu, 24 Aug 2017)

Log Message

Cherry-pick r221138. rdar://problem/34059603

Modified Paths

Diff

Modified: branches/safari-604.1.38.0-branch/Source/WebKit/ChangeLog (221144 => 221145)


--- branches/safari-604.1.38.0-branch/Source/WebKit/ChangeLog	2017-08-24 17:05:38 UTC (rev 221144)
+++ branches/safari-604.1.38.0-branch/Source/WebKit/ChangeLog	2017-08-24 17:31:56 UTC (rev 221145)
@@ -1,3 +1,25 @@
+2017-08-24  Jason Marcell  <jmarc...@apple.com>
+
+        Cherry-pick r221138. rdar://problem/34059603
+
+    2017-08-24  Chris Dumez  <cdu...@apple.com>
+
+            [iOS] ViewServices started by StoreKitUIService may get suspended unexpectedly
+            https://bugs.webkit.org/show_bug.cgi?id=175922
+            <rdar://problem/34028921>
+
+            Reviewed by Tim Horton.
+
+            ViewServices started by StoreKitUIService may get suspended unexpectedly. This is
+            because StoreKitUIService is itself a ViewService and is therefore in the background.
+            To address the issue, treat StoreKitUIService as initially foreground in
+            ApplicationStateTracker so that its ViewServices do not get suspended. We don't
+            have good way to deal with ViewServices started by other ViewServices unfortunately.
+
+            * Platform/spi/ios/UIKitSPI.h:
+            * UIProcess/ApplicationStateTracker.mm:
+            (WebKit::ApplicationStateTracker::ApplicationStateTracker):
+
 2017-08-11  Jason Marcell  <jmarc...@apple.com>
 
         Cherry-pick r220571. rdar://problem/33829964

Modified: branches/safari-604.1.38.0-branch/Source/WebKit/Platform/spi/ios/UIKitSPI.h (221144 => 221145)


--- branches/safari-604.1.38.0-branch/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2017-08-24 17:05:38 UTC (rev 221144)
+++ branches/safari-604.1.38.0-branch/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2017-08-24 17:31:56 UTC (rev 221145)
@@ -396,6 +396,7 @@
 
 @interface UIViewController (ViewService)
 - (pid_t)_hostProcessIdentifier;
+@property (readonly) NSString *_hostApplicationBundleIdentifier;
 @end
 
 @protocol UIViewControllerContextTransitioningEx <UIViewControllerContextTransitioning>

Modified: branches/safari-604.1.38.0-branch/Source/WebKit/UIProcess/ApplicationStateTracker.mm (221144 => 221145)


--- branches/safari-604.1.38.0-branch/Source/WebKit/UIProcess/ApplicationStateTracker.mm	2017-08-24 17:05:38 UTC (rev 221144)
+++ branches/safari-604.1.38.0-branch/Source/WebKit/UIProcess/ApplicationStateTracker.mm	2017-08-24 17:31:56 UTC (rev 221145)
@@ -146,6 +146,12 @@
         m_isInBackground = isBackgroundState([applicationStateMonitor mostElevatedApplicationStateForPID:applicationPID]);
         [applicationStateMonitor invalidate];
 
+        // Workaround for <rdar://problem/34028921>. If the host application is StoreKitUIService then it is also a ViewService
+        // and is always in the background. We need to treat StoreKitUIService as foreground for the purpose of process suspension
+        // or its ViewServices will get suspended.
+        if ([serviceViewController._hostApplicationBundleIdentifier isEqualToString:@"com.apple.ios.StoreKitUIService"])
+            m_isInBackground = false;
+
         m_didEnterBackgroundObserver = [notificationCenter addObserverForName:@"_UIViewServiceHostDidEnterBackgroundNotification" object:serviceViewController queue:nil usingBlock:[this](NSNotification *) {
             applicationDidEnterBackground();
         }];
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to