Adopt thread safety analysis annotations in WaveShaperProcessor and fix bugs found by clang.
Created attachment 430223 [details] Patch
Comment on attachment 430223 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=430223&action=review > Source/WebCore/Modules/webaudio/WaveShaperProcessor.cpp:96 > + for (size_t i = 0; i < m_kernels.size(); ++i) auto? > Source/WebCore/Modules/webaudio/WaveShaperProcessor.cpp:97 > + static_cast<WaveShaperDSPKernel&>(*m_kernels[i]).process(source->channel(i)->data(), destination->channel(i)->mutableData(), framesToProcess); Why do we need static_cast<WaveShaperDSPKernel&> now while we did not in the past?
Comment on attachment 430223 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=430223&action=review >> Source/WebCore/Modules/webaudio/WaveShaperProcessor.cpp:96 >> + for (size_t i = 0; i < m_kernels.size(); ++i) > > auto? What will be the type for auto i = 0? I want the type to be size_t to match kernels.size(). >> Source/WebCore/Modules/webaudio/WaveShaperProcessor.cpp:97 >> + static_cast<WaveShaperDSPKernel&>(*m_kernels[i]).process(source->channel(i)->data(), destination->channel(i)->mutableData(), framesToProcess); > > Why do we need static_cast<WaveShaperDSPKernel&> now while we did not in the past? No, this is just an optimization to avoid a virtual function call.
(In reply to Chris Dumez from comment #3) > Comment on attachment 430223 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=430223&action=review > > >> Source/WebCore/Modules/webaudio/WaveShaperProcessor.cpp:96 > >> + for (size_t i = 0; i < m_kernels.size(); ++i) > > > > auto? > > What will be the type for auto i = 0? I want the type to be size_t to match > kernels.size(). auto i = 0; would resolve auto to int so it wouldn't do what I want. > > >> Source/WebCore/Modules/webaudio/WaveShaperProcessor.cpp:97 > >> + static_cast<WaveShaperDSPKernel&>(*m_kernels[i]).process(source->channel(i)->data(), destination->channel(i)->mutableData(), framesToProcess); > > > > Why do we need static_cast<WaveShaperDSPKernel&> now while we did not in the past? > > No, this is just an optimization to avoid a virtual function call.
Committed r278307 (238344@main): <https://commits.webkit.org/238344@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 430223 [details].
<rdar://problem/78714897>