Changeset 221138 in webkit


Ignore:
Timestamp:
Aug 24, 2017 8:59:24 AM (7 years ago)
Author:
Chris Dumez
Message:

[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):

Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r221112 r221138  
     12017-08-24  Chris Dumez  <cdumez@apple.com>
     2
     3        [iOS] ViewServices started by StoreKitUIService may get suspended unexpectedly
     4        https://bugs.webkit.org/show_bug.cgi?id=175922
     5        <rdar://problem/34028921>
     6
     7        Reviewed by Tim Horton.
     8
     9        ViewServices started by StoreKitUIService may get suspended unexpectedly. This is
     10        because StoreKitUIService is itself a ViewService and is therefore in the background.
     11        To address the issue, treat StoreKitUIService as initially foreground in
     12        ApplicationStateTracker so that its ViewServices do not get suspended. We don't
     13        have good way to deal with ViewServices started by other ViewServices unfortunately.
     14
     15        * Platform/spi/ios/UIKitSPI.h:
     16        * UIProcess/ApplicationStateTracker.mm:
     17        (WebKit::ApplicationStateTracker::ApplicationStateTracker):
     18
    1192017-08-23  Youenn Fablet  <youenn@apple.com>
    220
  • trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h

    r220895 r221138  
    398398@interface UIViewController (ViewService)
    399399- (pid_t)_hostProcessIdentifier;
     400@property (readonly) NSString *_hostApplicationBundleIdentifier;
    400401@end
    401402
  • trunk/Source/WebKit/UIProcess/ApplicationStateTracker.mm

    r204466 r221138  
    147147        [applicationStateMonitor invalidate];
    148148
     149        // Workaround for <rdar://problem/34028921>. If the host application is StoreKitUIService then it is also a ViewService
     150        // and is always in the background. We need to treat StoreKitUIService as foreground for the purpose of process suspension
     151        // or its ViewServices will get suspended.
     152        if ([serviceViewController._hostApplicationBundleIdentifier isEqualToString:@"com.apple.ios.StoreKitUIService"])
     153            m_isInBackground = false;
     154
    149155        m_didEnterBackgroundObserver = [notificationCenter addObserverForName:@"_UIViewServiceHostDidEnterBackgroundNotification" object:serviceViewController queue:nil usingBlock:[this](NSNotification *) {
    150156            applicationDidEnterBackground();
Note: See TracChangeset for help on using the changeset viewer.