Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9830a21ee862d8286b9ccfa2c646f76f0f40695f
https://github.com/WebKit/WebKit/commit/9830a21ee862d8286b9ccfa2c646f76f0f40695f
Author: Ada Chan <[email protected]>
Date: 2025-06-13 (Fri, 13 Jun 2025)
Changed paths:
M Source/WebKit/ModelProcess/ModelConnectionToWebProcess.cpp
M Source/WebKit/ModelProcess/ModelProcessModelPlayerManagerProxy.cpp
M Source/WebKit/ModelProcess/ModelProcessModelPlayerManagerProxy.h
M Source/WebKit/UIProcess/Model/ModelProcessProxy.cpp
M Source/WebKit/UIProcess/WebProcessPool.cpp
M Source/WebKit/UIProcess/WebProcessPool.h
M Source/WebKit/UIProcess/WebProcessProxy.h
Log Message:
-----------
Allow the model process to go idle (or exit if under memory pressure) if
there are no more model players
https://bugs.webkit.org/show_bug.cgi?id=294365
rdar://153033560
Reviewed by Chris Dumez.
To make sure the model process can exit if under memory pressure after the
last model player has been removed, implement
ModelConnectionToWebProcess::allowsExitUnderMemoryPressure()
to return true if the number of model players is zero.
To allow the model process go idle, update
ModelProcessProxy::updateProcessAssertion()
to count only the foreground and background web content processes that actually
have models loaded.
* Source/WebKit/ModelProcess/ModelConnectionToWebProcess.cpp:
(WebKit::ModelConnectionToWebProcess::allowsExitUnderMemoryPressure const):
Return whether there are no more model players for the web process.
* Source/WebKit/ModelProcess/ModelProcessModelPlayerManagerProxy.cpp:
(WebKit::ModelProcessModelPlayerManagerProxy::hasModelPlayers const):
* Source/WebKit/ModelProcess/ModelProcessModelPlayerManagerProxy.h:
* Source/WebKit/UIProcess/Model/ModelProcessProxy.cpp:
(WebKit::ModelProcessProxy::updateProcessAssertion):
Only take into account the web processes that have models.
* Source/WebKit/UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::startedPlayingModels):
Need to update the model process assertions after model player updates.
(WebKit::WebProcessPool::stoppedPlayingModels):
Ditto.
(WebKit::WebProcessPool::hasForegroundWebProcessesWithModels const):
We already track the web processes that have model players, so just go
through that set of model players to see if any is in foreground.
(WebKit::WebProcessPool::hasBackgroundWebProcessesWithModels const):
Ditto for background web processes with models.
(WebKit::WebProcessPool::updateModelProcessAssertion):
(WebKit::WebProcessPool::updateProcessAssertions):
* Source/WebKit/UIProcess/WebProcessPool.h:
* Source/WebKit/UIProcess/WebProcessProxy.h:
Canonical link: https://commits.webkit.org/296196@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes