-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve safety of accessing RemoteLayerTreeContext's LayerPool
https://bugs.webkit.org/show_bug.cgi?id=274188 rdar://127480646 Reviewed by Geoffrey Garen. GraphicsLayerCARemote and PlatformCALayerRemote currently have raw pointers to a RemoteLayerTreeContext. In some rare cases, we try to access the LayerPool through the pointer after it was cleared, and this causes a crash. This patch avoids the crash by changing the PlatformCALayer::layerPool signature so it returns a pointer that we can null-check. And we replace the RemoteLayerTreeContext raw pointers with WeakPtr for additional safety. * Source/WebCore/platform/graphics/ca/PlatformCALayer.h: * Source/WebCore/platform/graphics/ca/PlatformCALayer.mm: (WebCore::PlatformCALayer::createCompatibleLayerOrTakeFromPool): (WebCore::PlatformCALayer::moveToLayerPool): (WebCore::PlatformCALayer::layerPool): * Source/WebKit/WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h: * Source/WebKit/WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.mm: (WebKit::GraphicsLayerCARemote::~GraphicsLayerCARemote): (WebKit::GraphicsLayerCARemote::moveToContext): (WebKit::GraphicsLayerCARemote::createAsyncContentsDisplayDelegate): (WebKit::GraphicsLayerCARemote::layerMode const): * Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h: (WebKit::PlatformCALayerRemote::context const): (WebKit::PlatformCALayerRemote::clearContext): Deleted. * Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.mm: (WebKit::PlatformCALayerRemote::~PlatformCALayerRemote): (WebKit::PlatformCALayerRemote::moveToContext): (WebKit::PlatformCALayerRemote::shouldIncludeDisplayListInBackingStore const): (WebKit::PlatformCALayerRemote::updateBackingStore): (WebKit::PlatformCALayerRemote::copyContentsFromLayer): (WebKit::PlatformCALayerRemote::addAnimationForKey): (WebKit::PlatformCALayerRemote::layerPool): * Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h: (WebKit::RemoteLayerTreeContext::create): * Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm: (WebKit::RemoteLayerTreeContext::~RemoteLayerTreeContext): * Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: * Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea): (WebKit::RemoteLayerTreeDrawingArea::graphicsLayerFactory): (WebKit::RemoteLayerTreeDrawingArea::adoptLayersFromDrawingArea): Canonical link: https://commits.webkit.org/278916@main
- Loading branch information
Matthew Finkel
committed
May 17, 2024
1 parent
a3042dc
commit 75beaa7
Showing
10 changed files
with
52 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters