Bug 214267 - Updated AudioContext constructor according to spec
Summary: Updated AudioContext constructor according to spec
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: Clark Wang
URL:
Keywords: InRadar
Depends on:
Blocks: 212611
  Show dependency treegraph
 
Reported: 2020-07-13 12:50 PDT by Clark Wang
Modified: 2020-07-14 08:52 PDT (History)
13 users (show)

See Also:


Attachments
Patch (29.50 KB, patch)
2020-07-13 13:07 PDT, Clark Wang
no flags Details | Formatted Diff | Diff
Patch (29.52 KB, patch)
2020-07-13 16:10 PDT, Clark Wang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Clark Wang 2020-07-13 12:50:25 PDT
Updated AudioContext constructor according to spec: https://www.w3.org/TR/webaudio/#AudioContext-constructors. Added in new files to support AudioContextOptions.
Comment 1 Clark Wang 2020-07-13 13:07:19 PDT
Created attachment 404168 [details]
Patch
Comment 2 Chris Dumez 2020-07-13 13:29:59 PDT
Comment on attachment 404168 [details]
Patch

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

> Source/WebCore/Modules/webaudio/AudioContext.cpp:68
> +    Optional<float> sampleRate = contextOptions.sampleRate;

This local variable is not needed.

> Source/WebCore/Modules/webaudio/AudioContext.cpp:78
> +AudioContext::AudioContext(Document& document, Optional<float> sampleRate)

I suggest passing the whole AudioContextOptions struct here.

> Source/WebCore/Modules/webaudio/BaseAudioContext.h:287
>      explicit BaseAudioContext(Document&);

I suggest passing the whole AudioContextOptions struct here (with a default value):
explicit BaseAudioContext(Document&, const AudioContextOptions& = { });

> Source/WebCore/Modules/webaudio/BaseAudioContext.h:289
> +    BaseAudioContext(Document&, Optional<float>);

Let's not add yet another constructor.

> Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.h:49
>      explicit DefaultAudioDestinationNode(BaseAudioContext&);

explicit DefaultAudioDestinationNode(BaseAudioContext&, Optional<float> = WTF::nullopt);

> Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.h:50
> +    DefaultAudioDestinationNode(BaseAudioContext&, Optional<float>);

Let's not add another constructor.

> LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/realtime-conv-expected.txt:3
> +FAIL Executing "test" promise_test: Unhandled rejection with value: object "SyntaxError: sampleRate is not in range"

Why are we failing this?
Comment 3 Clark Wang 2020-07-13 16:10:35 PDT
Created attachment 404191 [details]
Patch
Comment 4 EWS 2020-07-14 08:51:22 PDT
Committed r264342: <https://trac.webkit.org/changeset/264342>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 404191 [details].
Comment 5 Radar WebKit Bug Importer 2020-07-14 08:52:16 PDT
<rdar://problem/65545259>