Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't call deferNonVisibleProcessEarlyMemoryCleanupTimer from worker …
…threads https://bugs.webkit.org/show_bug.cgi?id=259170 rdar://110910174 Reviewed by Simon Fraser. We call deferNonVisibleProcessEarlyMemoryCleanupTimer in RemoteResourceCacheProxy::recordNativeImageUse. The idea there is to avoid discarding decoded image data in background tabs if the background tab is drawing images, which might be some canvas work, or it could be other things like Safari taking a tab snapshot. If we didn't avoid this, we could thrash between discarding decoded data and redecoding. OffscreenCanvas can also draw images on worker threads, but deferNonVisibleProcessEarlyMemoryCleanupTimer is not safe to call from non-main threads. We can safely skip this call if we're not on the main thread: workers do not have access to images which are stored in the MemoryCache, so we are not at risk of discarding decoded image data that the worker will want to re-decode to draw. * Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp: (WebKit::RemoteResourceCacheProxy::recordNativeImageUse): Canonical link: https://commits.webkit.org/266024@main
- Loading branch information