Bug 227444 - Make LocalSampleBufferDisplayLayer::requestNotificationWhenReadyForVideoData hop to main thread before hopping to processing thread
Summary: Make LocalSampleBufferDisplayLayer::requestNotificationWhenReadyForVideoData ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-06-28 05:14 PDT by youenn fablet
Modified: 2021-07-02 00:10 PDT (History)
5 users (show)

See Also:


Attachments
Patch (3.66 KB, patch)
2021-06-28 05:18 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2021-06-28 05:14:39 PDT
Make LocalSampleBufferDisplayLayer::requestNotificationWhenReadyForVideoData hop to main thread before hopping to processing thread
Comment 1 youenn fablet 2021-06-28 05:14:53 PDT
<rdar://79413368>
Comment 2 youenn fablet 2021-06-28 05:18:27 PDT
Created attachment 432384 [details]
Patch
Comment 3 youenn fablet 2021-07-01 03:41:40 PDT
ping review
Comment 4 Chris Dumez 2021-07-01 12:32:34 PDT
Comment on attachment 432384 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=432384&action=review

> Source/WebCore/platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm:401
> +        m_processingQueue->dispatch([this] {

Why is this safe? What guarantees that |this| is still alive when the lambda runs?
Comment 5 youenn fablet 2021-07-01 12:52:08 PDT
(In reply to Chris Dumez from comment #4)
> Comment on attachment 432384 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=432384&action=review
> 
> > Source/WebCore/platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm:401
> > +        m_processingQueue->dispatch([this] {
> 
> Why is this safe? What guarantees that |this| is still alive when the lambda
> runs?

We are doing a dispatchSync in LocalSampleBufferDisplayLayer destructor.
Comment 6 Chris Dumez 2021-07-01 12:54:21 PDT
Comment on attachment 432384 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=432384&action=review

>>> Source/WebCore/platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm:401
>>> +        m_processingQueue->dispatch([this] {
>> 
>> Why is this safe? What guarantees that |this| is still alive when the lambda runs?
> 
> We are doing a dispatchSync in LocalSampleBufferDisplayLayer destructor.

Ah, sneaky :) Seems safe indeed then. Sorry about the noise.
Comment 7 EWS 2021-07-02 00:09:59 PDT
Committed r279500 (239352@main): <https://commits.webkit.org/239352@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 432384 [details].