Changeset 295176 in webkit
- Timestamp:
- Jun 2, 2022, 11:45:08 PM (4 years ago)
- Location:
- branches/safari-613-branch/Source/WebKit
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
GPUProcess/graphics/RemoteGraphicsContextGL.cpp (modified) (1 diff)
-
GPUProcess/webrtc/LibWebRTCCodecsProxy.h (modified) (2 diffs)
-
GPUProcess/webrtc/LibWebRTCCodecsProxy.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-613-branch/Source/WebKit/ChangeLog
r295174 r295176 1 2022-04-22 Kimmo Kinnunen <kkinnunen@apple.com> 2 3 Multiple concurrency violations in LibWebRTCCodecsProxy 4 https://bugs.webkit.org/show_bug.cgi?id=236767 5 <rdar://88904160> 6 7 Reviewed by Antti Koivisto. 8 9 - ThreadMessageReceivers should not add IPC listeners in constructors, 10 as the delivery starts right away and uses the unconstructed virtual pointer. 11 - The work queue functions should not use GPUConnectionToWebProcess, as that is 12 main thread object. 13 - Locked m_encoders, m_decoders are sometimes accessed without lock. 14 15 Instead: 16 - Add the IPC listeners in initialize function. 17 - Remove the IPC listeners when GPUConnectionToWebProcess disconnects. 18 - Store the thread-safe conection, video frame object heap, process identity 19 objects as member variables. 20 - Do not lock m_encoders, m_decoders. If they are work queue instances, 21 just access them in the work queue functions. Add thread requirements 22 to the variables so that the compiler checks the access. 23 - Use IPC testing assertions when skipping incorrect messages. 24 - Use separate atomic counter (bool) to check if allowsExitUnderMemoryPressure. 25 26 No new tests, tested with existing tests and ASAN. 27 28 * GPUProcess/GPUConnectionToWebProcess.cpp: 29 (WebKit::GPUConnectionToWebProcess::~GPUConnectionToWebProcess): 30 (WebKit::GPUConnectionToWebProcess::didClose): 31 * GPUProcess/GPUConnectionToWebProcess.h: 32 * GPUProcess/webrtc/LibWebRTCCodecsProxy.h: 33 * GPUProcess/webrtc/LibWebRTCCodecsProxy.mm: 34 (WebKit::LibWebRTCCodecsProxy::create): 35 (WebKit::LibWebRTCCodecsProxy::LibWebRTCCodecsProxy): 36 (WebKit::LibWebRTCCodecsProxy::stopListeningForIPC): 37 (WebKit::LibWebRTCCodecsProxy::initialize): 38 (WebKit::LibWebRTCCodecsProxy::dispatchToThread): 39 (WebKit::LibWebRTCCodecsProxy::createDecoderCallback): 40 (WebKit::LibWebRTCCodecsProxy::createH264Decoder): 41 (WebKit::LibWebRTCCodecsProxy::createH265Decoder): 42 (WebKit::LibWebRTCCodecsProxy::createVP9Decoder): 43 (WebKit::LibWebRTCCodecsProxy::releaseDecoder): 44 (WebKit::LibWebRTCCodecsProxy::createEncoder): 45 (WebKit::LibWebRTCCodecsProxy::releaseEncoder): 46 (WebKit::LibWebRTCCodecsProxy::initializeEncoder): 47 (WebKit::LibWebRTCCodecsProxy::findEncoder): 48 (WebKit::LibWebRTCCodecsProxy::encodeFrame): 49 (WebKit::LibWebRTCCodecsProxy::setEncodeRates): 50 (WebKit::LibWebRTCCodecsProxy::setSharedVideoFrameSemaphore): 51 (WebKit::LibWebRTCCodecsProxy::setSharedVideoFrameMemory): 52 (WebKit::LibWebRTCCodecsProxy::allowsExitUnderMemoryPressure const): 53 1 54 2022-04-22 Kimmo Kinnunen <kkinnunen@apple.com> 2 55 -
branches/safari-613-branch/Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.cpp
r295172 r295176 253 253 void RemoteGraphicsContextGL::copyTextureFromMedia(WebCore::MediaPlayerIdentifier mediaPlayerIdentifier, uint32_t texture, uint32_t target, int32_t level, uint32_t internalFormat, uint32_t format, uint32_t type, bool premultiplyAlpha, bool flipY, CompletionHandler<void(bool)>&& completionHandler) 254 254 { 255 assertIsCurrent( m_workQueue());255 assertIsCurrent(workQueue()); 256 256 #if USE(AVFOUNDATION) 257 257 UNUSED_VARIABLE(premultiplyAlpha); -
branches/safari-613-branch/Source/WebKit/GPUProcess/webrtc/LibWebRTCCodecsProxy.h
r295173 r295176 32 32 #include "RTCDecoderIdentifier.h" 33 33 #include "RTCEncoderIdentifier.h" 34 #include <WebCore/ProcessIdentity.h> 34 35 #include <atomic> 35 36 #include <wtf/ThreadAssertions.h> … … 88 89 CFDictionaryRef ioSurfacePixelBufferCreationOptions(IOSurfaceRef); 89 90 91 Ref<IPC::Connection> m_connection; 92 Ref<WorkQueue> m_queue; 93 const WebCore::ProcessIdentity m_resourceOwner; 90 94 91 Ref<WorkQueue> m_queue;92 95 HashMap<RTCDecoderIdentifier, webrtc::LocalDecoder> m_decoders WTF_GUARDED_BY_LOCK(workQueue()); 93 96 HashMap<RTCEncoderIdentifier, webrtc::LocalEncoder> m_encoders WTF_GUARDED_BY_LOCK(workQueue()); -
branches/safari-613-branch/Source/WebKit/GPUProcess/webrtc/LibWebRTCCodecsProxy.mm
r295173 r295176 38 38 #import <WebCore/LibWebRTCProvider.h> 39 39 #import <WebCore/RemoteVideoSample.h> 40 #import <WebCore/MediaSampleAVFObjC.h> 40 41 #import <webrtc/sdk/WebKit/WebKitDecoder.h> 41 42 #import <webrtc/sdk/WebKit/WebKitEncoder.h>
Note:
See TracChangeset
for help on using the changeset viewer.