Bug 211297 - [iOS] ProcessThrottler fails to re-take ProcessAssertion if the previous one was invalidated
Summary: [iOS] ProcessThrottler fails to re-take ProcessAssertion if the previous one ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-05-01 09:53 PDT by Chris Dumez
Modified: 2020-05-18 03:58 PDT (History)
7 users (show)

See Also:


Attachments
Patch (8.64 KB, patch)
2020-05-01 09:57 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2020-05-01 09:53:57 PDT
Our ProcessAssertions may get invalidated upon backgrounding of the app. When the app becomes foreground and the ProcessThrottler tries to take a Foreground assertion as a result, it would incorrectly think it already had such assertion and not do anything, even though the previous one is no longer valid. As a result, the child processes would stay suspended even though the app was foregrounded.
Comment 1 Chris Dumez 2020-05-01 09:54:08 PDT
<rdar://problem/62542463>
Comment 2 Chris Dumez 2020-05-01 09:57:24 PDT
Created attachment 398194 [details]
Patch
Comment 3 Chris Dumez 2020-05-01 15:57:05 PDT
Comment on attachment 398194 [details]
Patch

Clearing flags on attachment: 398194

Committed r261034: <https://trac.webkit.org/changeset/261034>
Comment 4 Chris Dumez 2020-05-01 15:57:07 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Brent Fulgham 2020-05-01 15:59:59 PDT
Comment on attachment 398194 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=398194&action=review

> Source/WebKit/ChangeLog:15
> +        To address the issue, add a isValid() method to ProcessAssertion() and check it in

"add an isValid() ..."

> Source/WebKit/UIProcess/ios/ProcessAssertionIOS.mm:462
> +    bool shouldHoldBackgroundTask = isValid() && type() != ProcessAssertionType::Suspended;

It seems like this might be the only use of validity(). Should it be removed?
Comment 6 Chris Dumez 2020-05-01 16:01:58 PDT
Comment on attachment 398194 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=398194&action=review

> Source/WebKit/UIProcess/ProcessAssertion.h:-77
> -    Validity validity() const { return m_validity; }

See removal here.

>> Source/WebKit/UIProcess/ios/ProcessAssertionIOS.mm:462
>> +    bool shouldHoldBackgroundTask = isValid() && type() != ProcessAssertionType::Suspended;
> 
> It seems like this might be the only use of validity(). Should it be removed?

It was removed.