-
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.
[Cocoa] Thread-unsafe use of Vector in WebAVSampleBufferErrorListener
https://bugs.webkit.org/show_bug.cgi?id=264217 rdar://117950166 Reviewed by Eric Carlson. WebAVSampleBufferErrorListener contains two Vectors (_layers and _renderers) that are accessed from the main thread as well as whichever thread AVFoundation uses to post notifications and key-value observation callbacks; this is unsafe. Addressed this by ensuring both Vectors are accessed on the main thread. Also did the following: - Renamed WebAVSampleBufferErrorListener to WebAVSampleBufferListener since it observes more than just errors. - Made use of context pointers in the key-value observer to make WebAVSampleBufferListener safe for subclassing. - Fixed some style issues. * Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (-[WebAVSampleBufferListener initWithParent:]): (-[WebAVSampleBufferListener invalidate]): (-[WebAVSampleBufferListener beginObservingLayer:]): (-[WebAVSampleBufferListener stopObservingLayer:]): (-[WebAVSampleBufferListener beginObservingRenderer:]): (-[WebAVSampleBufferListener stopObservingRenderer:]): (-[WebAVSampleBufferListener observeValueForKeyPath:ofObject:change:context:]): (-[WebAVSampleBufferListener layerFailedToDecode:]): (-[WebAVSampleBufferListener layerRequiresFlushToResumeDecodingChanged:]): (-[WebAVSampleBufferListener audioRendererWasAutomaticallyFlushed:]): (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::destroyRenderers): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::setVideoLayer): (-[WebAVSampleBufferErrorListener initWithParent:]): Deleted. (-[WebAVSampleBufferErrorListener dealloc]): Deleted. (-[WebAVSampleBufferErrorListener invalidate]): Deleted. (-[WebAVSampleBufferErrorListener beginObservingLayer:]): Deleted. (-[WebAVSampleBufferErrorListener stopObservingLayer:]): Deleted. (-[WebAVSampleBufferErrorListener beginObservingRenderer:]): Deleted. (-[WebAVSampleBufferErrorListener stopObservingRenderer:]): Deleted. (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]): Deleted. (-[WebAVSampleBufferErrorListener layerFailedToDecode:]): Deleted. (-[WebAVSampleBufferErrorListener layerRequiresFlushToResumeDecodingChanged:]): Deleted. (-[WebAVSampleBufferErrorListener layerReadyForDisplayChanged:]): Deleted. (-[WebAVSampleBufferErrorListener audioRendererWasAutomaticallyFlushed:]): Deleted. Canonical link: https://commits.webkit.org/270237@main
- Loading branch information
Showing
2 changed files
with
106 additions
and
85 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