[webkit-changes] [WebKit/WebKit] 1ace3d: Don't call deferNonVisibleProcessEarlyMemoryCleanu...

Cameron McCormack noreply at github.com
Wed Jul 12 21:53:11 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1ace3d3f33b26d072a9c04c962986b2912232557
      https://github.com/WebKit/WebKit/commit/1ace3d3f33b26d072a9c04c962986b2912232557
  Author: Cameron McCormack <heycam at apple.com>
  Date:   2023-07-12 (Wed, 12 Jul 2023)

  Changed paths:
    M Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp

  Log Message:
  -----------
  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




More information about the webkit-changes mailing list