-
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.
Cherry-pick 265870.524@safari-7616-branch (5a87cf9). https://bugs.web…
…kit.org/show_bug.cgi?id=255629 Regression(264919@main) Use-after-free of MediaRecorderPrivate in GPUProcessConnection::didClose() https://bugs.webkit.org/show_bug.cgi?id=261224 rdar://114807341 Reviewed by Alex Christensen. 264919@main made WebKit::MediaRecorderPrivate subclass ThreadSafeRefCountedAndCanMakeThreadSafeWeakPtr. However, MediaRecorderPrivate is stored in std::unique_ptr<> throughout our code base, thus not obeying the refcount when managing its lifetime. This was the source of use-after-frees in GPUProcessConnection::didClose(), which held a strong Ref<> to the MediaRecorderPrivate but it wouldn't prevent the object from dying. To address the issue, we now use Ref<> / RefPtr<> everywhere for MediaRecorderPrivate. I also moved ThreadSafeRefCountedAndCanMakeThreadSafeWeakPtr to the base class (WebCore::MediaRecorderPrivate) since WebCore needs to know it can hold a Ref<> / RefPtr<> to such objects. * Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::createMediaRecorderPrivate): (WebCore::MediaRecorder::fetchData): * Source/WebCore/Modules/mediarecorder/MediaRecorder.h: * Source/WebCore/Modules/mediarecorder/MediaRecorderProvider.cpp: (WebCore::MediaRecorderProvider::createMediaRecorderPrivate): * Source/WebCore/Modules/mediarecorder/MediaRecorderProvider.h: * Source/WebCore/loader/EmptyClients.cpp: * Source/WebCore/platform/mediarecorder/MediaRecorderPrivate.h: * Source/WebCore/platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: (WebCore::MediaRecorderPrivateAVFImpl::create): * Source/WebCore/platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: * Source/WebCore/platform/mediarecorder/MediaRecorderPrivateGStreamer.cpp: (WebCore::MediaRecorderPrivateGStreamer::create): * Source/WebCore/platform/mediarecorder/MediaRecorderPrivateGStreamer.h: * Source/WebCore/platform/mediarecorder/MediaRecorderPrivateMock.cpp: (WebCore::MediaRecorderPrivateMock::create): * Source/WebCore/platform/mediarecorder/MediaRecorderPrivateMock.h: * Source/WebCore/testing/Internals.cpp: (WebCore::createRecorderMockSource): * Source/WebKit/WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp: (WebKit::MediaRecorderPrivate::create): * Source/WebKit/WebProcess/GPU/webrtc/MediaRecorderPrivate.h: * Source/WebKit/WebProcess/GPU/webrtc/MediaRecorderProvider.cpp: (WebKit::MediaRecorderProvider::createMediaRecorderPrivate): * Source/WebKit/WebProcess/GPU/webrtc/MediaRecorderProvider.h: Canonical link: https://commits.webkit.org/265870.524@safari-7616-branch
- Loading branch information
1 parent
027d2d6
commit 34b8065
Showing
17 changed files
with
50 additions
and
39 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
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