Bug 259170
Summary: | don't call deferNonVisibleProcessEearlyMemoryCleanupTimer from worker threads | ||
---|---|---|---|
Product: | WebKit | Reporter: | Cameron McCormack (:heycam) <heycam> |
Component: | WebKit Process Model | Assignee: | Cameron McCormack (:heycam) <heycam> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Cameron McCormack (:heycam)
We call deferNonVisibleProcessEearlyMemoryCleanupTimer 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 deferNonVisibleProcessEearlyMemoryCleanupTimer 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.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Cameron McCormack (:heycam)
rdar://110910174
Cameron McCormack (:heycam)
Pull request: https://github.com/WebKit/WebKit/pull/15805
EWS
Committed 266024@main (1ace3d3f33b2): <https://commits.webkit.org/266024@main>
Reviewed commits have been landed. Closing PR #15805 and removing active labels.