⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 280639 in webkit


Ignore:
Timestamp:
Aug 4, 2021, 10:43:14 AM (5 years ago)
Author:
Said Abou-Hallawa
Message:

[GPU Process] REGRESSION: iCloud Photos Web app may crash WebProcess once the GPUProcess is relaunched
https://bugs.webkit.org/show_bug.cgi?id=228665

Reviewed by Simon Fraser.

When the GPUProcess is relaunched, ensure NativeImage is detached from
the RemoteResourceCacheProxy once it is removed from its m_nativeImages.

Otherwise the NativeImage later will ask RemoteResourceCacheProxy to
release its corresponding NativeImage from RemoteResourceCache even
though it was destroyed when the GPUProcess was relaunched.

  • WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp:

(WebKit::RemoteResourceCacheProxy::~RemoteResourceCacheProxy):
(WebKit::RemoteResourceCacheProxy::clearNativeImageMap):
(WebKit::RemoteResourceCacheProxy::remoteResourceCacheWasDestroyed):

  • WebProcess/GPU/graphics/RemoteResourceCacheProxy.h:
Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r280628 r280639  
     12021-08-04  Said Abou-Hallawa  <said@apple.com>
     2
     3        [GPU Process] REGRESSION: iCloud Photos Web app may crash WebProcess once the GPUProcess is relaunched
     4        https://bugs.webkit.org/show_bug.cgi?id=228665
     5
     6        Reviewed by Simon Fraser.
     7
     8        When the GPUProcess is relaunched, ensure NativeImage is detached from
     9        the RemoteResourceCacheProxy once it is removed from its m_nativeImages.
     10
     11        Otherwise the NativeImage later will ask RemoteResourceCacheProxy to
     12        release its corresponding NativeImage from RemoteResourceCache even
     13        though it was destroyed when the GPUProcess was relaunched.
     14
     15        * WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp:
     16        (WebKit::RemoteResourceCacheProxy::~RemoteResourceCacheProxy):
     17        (WebKit::RemoteResourceCacheProxy::clearNativeImageMap):
     18        (WebKit::RemoteResourceCacheProxy::remoteResourceCacheWasDestroyed):
     19        * WebProcess/GPU/graphics/RemoteResourceCacheProxy.h:
     20
    1212021-08-03  Jean-Yves Avenard  <jya@apple.com>
    222
  • trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp

    r280401 r280639  
    4242RemoteResourceCacheProxy::~RemoteResourceCacheProxy()
    4343{
    44     for (auto& nativeImageState : m_nativeImages.values())
    45         nativeImageState.image->removeObserver(*this);
     44    clearNativeImageMap();
    4645}
    4746
     
    152151
    153152    m_remoteRenderingBackendProxy.releaseRemoteResource(renderingResourceIdentifier, useCount);
     153}
     154
     155void RemoteResourceCacheProxy::clearNativeImageMap()
     156{
     157    for (auto& nativeImageState : m_nativeImages.values())
     158        nativeImageState.image->removeObserver(*this);
     159    m_nativeImages.clear();
    154160}
    155161
     
    205211        item.imageBuffer->clearBackend();
    206212    }
    207     m_nativeImages.clear();
     213    clearNativeImageMap();
    208214    clearFontMap();
    209215}
  • trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.h

    r280401 r280639  
    8080   
    8181    void releaseNativeImage(WebCore::RenderingResourceIdentifier) override;
     82    void clearNativeImageMap();
     83
    8284    void finalizeRenderingUpdateForFonts();
    8385    void prepareForNextRenderingUpdate();
Note: See TracChangeset for help on using the changeset viewer.