The UIProcess may get killed for trying to stay runnable in the background for more than 30 seconds.
<rdar://problem/50001505>
Created attachment 368490 [details] Patch
Comment on attachment 368490 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=368490&action=review > Source/WebKit/UIProcess/ios/ProcessAssertionIOS.mm:72 > + [self _updateBackgroundTask]; I think you need to capture a weak reference to self, otherwise you have a memory leak (the global Notification Center has a reference to self, and never goes away). Once that leak is fixed, don't we also need to unregister for this notification in our dealloc method?
Comment on attachment 368490 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=368490&action=review >> Source/WebKit/UIProcess/ios/ProcessAssertionIOS.mm:72 >> + [self _updateBackgroundTask]; > > I think you need to capture a weak reference to self, otherwise you have a memory leak (the global Notification Center has a reference to self, and never goes away). > > Once that leak is fixed, don't we also need to unregister for this notification in our dealloc method? self is a static object though, so I would not expect the dealloc method to ever get called.
Comment on attachment 368490 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=368490&action=review >>> Source/WebKit/UIProcess/ios/ProcessAssertionIOS.mm:72 >>> + [self _updateBackgroundTask]; >> >> I think you need to capture a weak reference to self, otherwise you have a memory leak (the global Notification Center has a reference to self, and never goes away). >> >> Once that leak is fixed, don't we also need to unregister for this notification in our dealloc method? > > self is a static object though, so I would not expect the dealloc method to ever get called. I mean that WKProcessAssertionBackgroundTaskManager (self) is a singleton, so "leaking" it is the expectation.
Comment on attachment 368490 [details] Patch r=me
Comment on attachment 368490 [details] Patch Clearing flags on attachment: 368490 Committed r244761: <https://trac.webkit.org/changeset/244761>
All reviewed patches have been landed. Closing bug.