RESOLVED FIXED 214989
Add constructor for WaveShaperNode
https://bugs.webkit.org/show_bug.cgi?id=214989
Summary Add constructor for WaveShaperNode
Chris Dumez
Reported 2020-07-30 14:34:01 PDT
Add constructor for WaveShaperNode: - https://www.w3.org/TR/webaudio/#waveshapernode
Attachments
Patch (48.08 KB, patch)
2020-07-30 14:38 PDT, Chris Dumez
no flags
Patch (49.28 KB, patch)
2020-07-30 16:52 PDT, Chris Dumez
no flags
Patch (49.29 KB, patch)
2020-07-30 17:02 PDT, Chris Dumez
no flags
Patch (49.34 KB, patch)
2020-07-31 09:33 PDT, Chris Dumez
no flags
Patch (49.40 KB, patch)
2020-07-31 10:39 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2020-07-30 14:38:21 PDT
Clark Wang
Comment 2 2020-07-30 16:14:30 PDT
Comment on attachment 405621 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=405621&action=review > Source/WebCore/Modules/webaudio/WaveShaperNode.cpp:70 > + node->setCurve(curve.get()); I think there needs to be a check if curve has length < 2, according to curve's spec: https://www.w3.org/TR/webaudio/#dom-waveshapernode-curve. Maybe it can inside of setCurve, or we can also catch it earlier.
Chris Dumez
Comment 3 2020-07-30 16:18:29 PDT
(In reply to Clark Wang from comment #2) > Comment on attachment 405621 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=405621&action=review > > > Source/WebCore/Modules/webaudio/WaveShaperNode.cpp:70 > > + node->setCurve(curve.get()); > > I think there needs to be a check if curve has length < 2, according to > curve's spec: https://www.w3.org/TR/webaudio/#dom-waveshapernode-curve. > Maybe it can inside of setCurve, or we can also catch it earlier. Indeed. Will fix, thanks.
Chris Dumez
Comment 4 2020-07-30 16:52:04 PDT
Chris Dumez
Comment 5 2020-07-30 17:02:51 PDT
youenn fablet
Comment 6 2020-07-31 02:54:17 PDT
Comment on attachment 405639 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=405639&action=review > Source/WebCore/Modules/webaudio/WaveShaperNode.cpp:40 > +ExceptionOr<Ref<WebCore::WaveShaperNode>> WaveShaperNode::create(BaseAudioContext& context, const WaveShaperOptions &options) s/WebCore::// s/WaveShaperOptions &/WaveShaperOptions&/ > Source/WebCore/Modules/webaudio/WaveShaperNode.cpp:70 > + result = node->setCurve(curve.get()); WTFMove > Source/WebCore/Modules/webaudio/WaveShaperNode.cpp:89 > +ExceptionOr<void> WaveShaperNode::setCurve(RefPtr<Float32Array>&& curve) Why &&, it does not seem we move curve inside?
youenn fablet
Comment 7 2020-07-31 02:54:46 PDT
Win failure seems legit, please fix it before landing.
Chris Dumez
Comment 8 2020-07-31 09:29:58 PDT
(In reply to youenn fablet from comment #6) > Comment on attachment 405639 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=405639&action=review > > > Source/WebCore/Modules/webaudio/WaveShaperNode.cpp:40 > > +ExceptionOr<Ref<WebCore::WaveShaperNode>> WaveShaperNode::create(BaseAudioContext& context, const WaveShaperOptions &options) Fixed. > > s/WebCore::// > s/WaveShaperOptions &/WaveShaperOptions&/ > > > Source/WebCore/Modules/webaudio/WaveShaperNode.cpp:70 > > + result = node->setCurve(curve.get()); > > WTFMove Fixed. > > > Source/WebCore/Modules/webaudio/WaveShaperNode.cpp:89 > > +ExceptionOr<void> WaveShaperNode::setCurve(RefPtr<Float32Array>&& curve) > > Why &&, it does not seem we move curve inside? This is a setter so && makes sense. The generated bindings are also passing us an rvalue reference. It is true that this implementation is currently not leveraging this (it probably could with some further refactoring) but it could at some point.
Chris Dumez
Comment 9 2020-07-31 09:33:16 PDT
(In reply to youenn fablet from comment #7) > Win failure seems legit, please fix it before landing. I was missing a #if ENABLE(WEB_AUDIO)
Chris Dumez
Comment 10 2020-07-31 09:33:38 PDT
Chris Dumez
Comment 11 2020-07-31 10:39:56 PDT
EWS
Comment 12 2020-07-31 11:47:54 PDT
Committed r265152: <https://trac.webkit.org/changeset/265152> All reviewed patches have been landed. Closing bug and clearing flags on attachment 405707 [details].
Radar WebKit Bug Importer
Comment 13 2020-07-31 11:48:20 PDT
Note You need to log in before you can comment on or make changes to this bug.