[webkit-reviews] review granted: [Bug 215093] Add constructor for GainNode : [Attachment 405856] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 3 13:21:48 PDT 2020


Eric Carlson <eric.carlson at apple.com> has granted Chris Dumez
<cdumez at apple.com>'s request for review:
Bug 215093: Add constructor for GainNode
https://bugs.webkit.org/show_bug.cgi?id=215093

Attachment 405856: Patch

https://bugs.webkit.org/attachment.cgi?id=405856&action=review




--- Comment #2 from Eric Carlson <eric.carlson at apple.com> ---
Comment on attachment 405856
  --> https://bugs.webkit.org/attachment.cgi?id=405856
Patch

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

> Source/WebCore/Modules/webaudio/GainNode.cpp:59
> +    auto result =
gainNode->setChannelCount(options.channelCount.valueOr(2));
> +    if (result.hasException())
> +	   return result.releaseException();
> +
> +    result =
gainNode->setChannelCountMode(options.channelCountMode.valueOr(ChannelCountMode
::Max));
> +    if (result.hasException())
> +	   return result.releaseException();
> +
> +    result =
gainNode->setChannelInterpretation(options.channelInterpretation.valueOr(Channe
lInterpretation::Speakers));
> +    if (result.hasException())
> +	   return result.releaseException();

This coded is duplicated in at least six nodes now. It would be better to have
an AudioNode constructor or method that takes an AudioNodeOptions.

> Source/WebCore/Modules/webaudio/GainNode.h:42
> +    static ExceptionOr<Ref<GainNode>> create(BaseAudioContext& context,
const GainOptions& = { });

Won't the bindings generator always pass a default-initialized dictionary?


More information about the webkit-reviews mailing list