Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPUProcess doesn't get notified of imminent process suspension #415

Merged
merged 0 commits into from Apr 28, 2022
Merged

GPUProcess doesn't get notified of imminent process suspension #415

merged 0 commits into from Apr 28, 2022

Conversation

cdumez
Copy link
Contributor

@cdumez cdumez commented Apr 27, 2022

d09a083

GPUProcess doesn't get notified of imminent process suspension
https://bugs.webkit.org/show_bug.cgi?id=239815

Reviewed by Tim Horton.

By defaults, ProcessThrottler in the UIProcess use a ProcessAndUIAssertion instance internally,
instead of a simple ProcessAssertion. This makes sure that a process assertion is taken on
behalf of the UIProcess as well, not just the child process. This also makes sure that when
the UIProcess has been in the background for too long and its assertion gets invalidated, we
release all ProcessAndUIAssertion instances as well.

The WebProcess and NetworkProcess were correctly using a ProcessAndUIAssertion. However, the
GPUProcess was passing `false` when constructing the ProcessThrottler, causing it to use a
simple ProcessAssertion. As a result, the GPUProcess would not get notified on imminent
suspension when the app has been running in the background for too long.

This patch aligns the behavior of the GPUProcess with the one of the NetworkProcess since
both processes are very similar.

* Source/WebKit/UIProcess/GPU/GPUProcessProxy.cpp:
(WebKit::GPUProcessProxy::GPUProcessProxy):
* Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::NetworkProcessProxy):
(WebKit::anyProcessPoolShouldTakeUIBackgroundAssertion): Deleted.
* Source/WebKit/UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::anyProcessPoolNeedsUIBackgroundAssertion):
* Source/WebKit/UIProcess/WebProcessPool.h:

Canonical link: https://commits.webkit.org/250076@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@293562 268f45cc-cd09-0410-ab3c-d52691b4dbfc

@cdumez cdumez self-assigned this Apr 27, 2022
@cdumez cdumez added WebKit Nightly Build WebKit2 Bugs relating to the WebKit2 API layer labels Apr 27, 2022
@cdumez cdumez added the merge-queue Applied to send a pull request to merge-queue label Apr 28, 2022
@webkit-early-warning-system webkit-early-warning-system merged commit d09a083 into WebKit:main Apr 28, 2022
@webkit-early-warning-system
Copy link
Collaborator

Committed r293562 (250076@main): https://commits.webkit.org/250076@main

Reviewed commits have been landed. Closing PR #415 and removing active labels.

@webkit-early-warning-system webkit-early-warning-system removed the merge-queue Applied to send a pull request to merge-queue label Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebKit2 Bugs relating to the WebKit2 API layer
Projects
None yet
3 participants