Skip to content

Commit

Permalink
WKInactiveSchedulingPolicyThrottle / WKInactiveSchedulingPolicyNone m…
Browse files Browse the repository at this point in the history
…ay still cause process suspension

https://bugs.webkit.org/show_bug.cgi?id=270609
rdar://123854747

Reviewed by Ben Nham.

WKInactiveSchedulingPolicyThrottle / WKInactiveSchedulingPolicyNone may still
cause process suspension. They don't set the "shouldDropNearSuspendedAssertionAfterDelay"
setting, which means that we may end up dropping the suspended assertion after
some delay and the processes would suspend, even though the API indicates that
the processes will not suspend in those modes.

* Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences setInactiveSchedulingPolicy:]):

Canonical link: https://commits.webkit.org/275807@main
  • Loading branch information
cdumez committed Mar 7, 2024
1 parent c7469f3 commit f64effb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,17 @@ - (void)setInactiveSchedulingPolicy:(WKInactiveSchedulingPolicy)policy
case WKInactiveSchedulingPolicySuspend:
_preferences->setShouldTakeNearSuspendedAssertions(false);
_preferences->setBackgroundWebContentRunningBoardThrottlingEnabled(true);
_preferences->setShouldDropNearSuspendedAssertionAfterDelay(WebKit::defaultShouldDropNearSuspendedAssertionAfterDelay());
break;
case WKInactiveSchedulingPolicyThrottle:
_preferences->setShouldTakeNearSuspendedAssertions(true);
_preferences->setBackgroundWebContentRunningBoardThrottlingEnabled(true);
_preferences->setShouldDropNearSuspendedAssertionAfterDelay(false);
break;
case WKInactiveSchedulingPolicyNone:
_preferences->setShouldTakeNearSuspendedAssertions(true);
_preferences->setBackgroundWebContentRunningBoardThrottlingEnabled(false);
_preferences->setShouldDropNearSuspendedAssertionAfterDelay(false);
break;
default:
ASSERT_NOT_REACHED();
Expand Down

0 comments on commit f64effb

Please sign in to comment.