Bug 226476 - Fix thread safety issues in MediaStreamAudioSourceNode
Summary: Fix thread safety issues in MediaStreamAudioSourceNode
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-31 17:30 PDT by Chris Dumez
Modified: 2021-06-01 08:36 PDT (History)
13 users (show)

See Also:


Attachments
Patch (4.85 KB, patch)
2021-05-31 17:34 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (4.48 KB, patch)
2021-06-01 07:48 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2021-05-31 17:30:43 PDT
Adopt thread safety analysis annotations in MediaStreamAudioSourceNode and fix bugs found by clang.
Comment 1 Chris Dumez 2021-05-31 17:34:00 PDT
Created attachment 430219 [details]
Patch
Comment 2 youenn fablet 2021-06-01 04:57:49 PDT
Comment on attachment 430219 [details]
Patch

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

> Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.cpp:109
> +    if (sourceSampleRate == sampleRate())

We could keep a single sampleRate call as a minor optimization.
Comment 3 Chris Dumez 2021-06-01 07:37:00 PDT
(In reply to youenn fablet from comment #2)
> Comment on attachment 430219 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=430219&action=review
> 
> > Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.cpp:109
> > +    if (sourceSampleRate == sampleRate())
> 
> We could keep a single sampleRate call as a minor optimization.

SampleRate() is an in-line function so it did not seem worth it?
Comment 4 youenn fablet 2021-06-01 07:44:56 PDT
(In reply to Chris Dumez from comment #3)
> (In reply to youenn fablet from comment #2)
> > Comment on attachment 430219 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=430219&action=review
> > 
> > > Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.cpp:109
> > > +    if (sourceSampleRate == sampleRate())
> > 
> > We could keep a single sampleRate call as a minor optimization.
> 
> SampleRate() is an in-line function so it did not seem worth it?

Isn't it a virtual method?
Comment 5 Chris Dumez 2021-06-01 07:46:11 PDT
(In reply to youenn fablet from comment #4)
> (In reply to Chris Dumez from comment #3)
> > (In reply to youenn fablet from comment #2)
> > > Comment on attachment 430219 [details]
> > > Patch
> > > 
> > > View in context:
> > > https://bugs.webkit.org/attachment.cgi?id=430219&action=review
> > > 
> > > > Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.cpp:109
> > > > +    if (sourceSampleRate == sampleRate())
> > > 
> > > We could keep a single sampleRate call as a minor optimization.
> > 
> > SampleRate() is an in-line function so it did not seem worth it?
> 
> Isn't it a virtual method?

Oh, it is. and it isn't inline either. I was confused.
Comment 6 Chris Dumez 2021-06-01 07:48:21 PDT
Created attachment 430261 [details]
Patch
Comment 7 Chris Dumez 2021-06-01 08:08:14 PDT
(In reply to Chris Dumez from comment #5)
> (In reply to youenn fablet from comment #4)
> > (In reply to Chris Dumez from comment #3)
> > > (In reply to youenn fablet from comment #2)
> > > > Comment on attachment 430219 [details]
> > > > Patch
> > > > 
> > > > View in context:
> > > > https://bugs.webkit.org/attachment.cgi?id=430219&action=review
> > > > 
> > > > > Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.cpp:109
> > > > > +    if (sourceSampleRate == sampleRate())
> > > > 
> > > > We could keep a single sampleRate call as a minor optimization.
> > > 
> > > SampleRate() is an in-line function so it did not seem worth it?
> > 
> > Isn't it a virtual method?
> 
> Oh, it is. and it isn't inline either. I was confused.

Fixed before landing, thanks for catching.
Comment 8 EWS 2021-06-01 08:35:01 PDT
Committed r278309 (238346@main): <https://commits.webkit.org/238346@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 430261 [details].
Comment 9 Radar WebKit Bug Importer 2021-06-01 08:36:16 PDT
<rdar://problem/78715855>