Title: [269934] trunk/Source/WebKit
- Revision
- 269934
- Author
- [email protected]
- Date
- 2020-11-17 16:36:12 -0800 (Tue, 17 Nov 2020)
Log Message
Make sure ProcessThrottler is always holding a ProcessAssertion for its child process
https://bugs.webkit.org/show_bug.cgi?id=219053
Reviewed by Geoff Garen.
Make sure ProcessThrottler is always holding a ProcessAssertion for its child process. Previously, when changing the assertion
type (e.g. when going from background to foreground) we would release the previous assertion and then take the new one.
RunningBoard developers recommend that we wait until the new ProcessAssertion is taken before we release the previous one to
avoid churn. It is also important we always hold a ProcessAssertion at all times for the child process because the child process
may exit otherwise.
* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::setAssertionType):
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (269933 => 269934)
--- trunk/Source/WebKit/ChangeLog 2020-11-18 00:04:16 UTC (rev 269933)
+++ trunk/Source/WebKit/ChangeLog 2020-11-18 00:36:12 UTC (rev 269934)
@@ -1,5 +1,22 @@
2020-11-17 Chris Dumez <[email protected]>
+ Make sure ProcessThrottler is always holding a ProcessAssertion for its child process
+ https://bugs.webkit.org/show_bug.cgi?id=219053
+
+ Reviewed by Geoff Garen.
+
+ Make sure ProcessThrottler is always holding a ProcessAssertion for its child process. Previously, when changing the assertion
+ type (e.g. when going from background to foreground) we would release the previous assertion and then take the new one.
+
+ RunningBoard developers recommend that we wait until the new ProcessAssertion is taken before we release the previous one to
+ avoid churn. It is also important we always hold a ProcessAssertion at all times for the child process because the child process
+ may exit otherwise.
+
+ * UIProcess/ProcessThrottler.cpp:
+ (WebKit::ProcessThrottler::setAssertionType):
+
+2020-11-17 Chris Dumez <[email protected]>
+
[macOS] Stop using RunLoopType=_WebKit starting in Big Sur
https://bugs.webkit.org/show_bug.cgi?id=219052
<rdar://problem/61742969>
Modified: trunk/Source/WebKit/UIProcess/ProcessThrottler.cpp (269933 => 269934)
--- trunk/Source/WebKit/UIProcess/ProcessThrottler.cpp 2020-11-18 00:04:16 UTC (rev 269933)
+++ trunk/Source/WebKit/UIProcess/ProcessThrottler.cpp 2020-11-18 00:36:12 UTC (rev 269934)
@@ -127,6 +127,10 @@
return;
PROCESSTHROTTLER_RELEASE_LOG("setAssertionType: Updating process assertion type to %u (foregroundActivities: %u, backgroundActivities: %u)", newType, m_foregroundActivities.size(), m_backgroundActivities.size());
+
+ // Keep the previous assertion around until after the new one has been created so that we always hold
+ // a process assertion for the process.
+ auto previousAssertion = std::exchange(m_assertion, nullptr);
if (m_shouldTakeUIBackgroundAssertion) {
auto assertion = makeUnique<ProcessAndUIAssertion>(m_processIdentifier, assertionName(newType), newType);
assertion->setUIAssertionExpirationHandler([this] {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes