Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hideContentUntilPendingUpdate async IPC call during backgrounding blo…
…cks process suspension https://bugs.webkit.org/show_bug.cgi?id=268799 rdar://121185956 Reviewed by Chris Dumez. On iOS, when the UIProcess goes into the background, it eventually calls in to hideContentUntilPendingUpdate through this call stack: ``` WebKit::RemoteLayerTreeDrawingAreaProxy::hideContentUntilPendingUpdate() WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground() WebKit::ApplicationStateTracker::didCompleteSnapshotSequence() ``` The problem is that we recently added an async `DrawingArea::DispatchAfterEnsuringDrawing` IPC with reply handler call to hideContentUntilPendingUpdate (see 269776@main, 270672@main, 271260@main). An async IPC with a reply handler in the UIProcess implicitly takes out a background activity which prevents the WebContent process (and also the UIProcess) from suspending until the reply handler runs. Unfortunately, since the WebContent process is in the background, presumably it doesn't render, so the DispatchAfterEnsuringDrawing reply handler doesn't run, and the background activity also never completes. We basically end up blocking process suspension entirely until the 15 second timer in ProcessStateMonitor expires and forcefully invalidates all background activities for all processes. We need to fix this by reworking the logic somehow or by making this DispatchAfterEnsuringDrawing IPC not create a background activity. Here I'm just trying to make the IPC call not start a background activity. Note that there's also a DispatchAfterEnsuringDrawing call in WebPageProxy that I didn't touch since I don't have evidence that it's causing a background power regression, but I wonder if that also should avoid creating a background activity. * Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::hideContentUntilPendingUpdate): Canonical link: https://commits.webkit.org/274157@main
- Loading branch information