Bug 217194 - Add stubs for AudioWorkletProcessor and AudioWorkletGlobalScope
Summary: Add stubs for AudioWorkletProcessor and AudioWorkletGlobalScope
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: 217153
Blocks: 217058 217242
  Show dependency treegraph
 
Reported: 2020-10-01 16:07 PDT by Chris Dumez
Modified: 2020-10-02 12:22 PDT (History)
18 users (show)

See Also:


Attachments
Patch (274.36 KB, patch)
2020-10-01 16:18 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (278.61 KB, patch)
2020-10-01 18:16 PDT, Chris Dumez
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (278.64 KB, patch)
2020-10-01 18:36 PDT, Chris Dumez
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2020-10-01 16:07:05 PDT
Add stubs for AudioWorkletProcessor and AudioWorkletGlobalScope:
- https://www.w3.org/TR/webaudio/#audioworkletprocessor
- https://www.w3.org/TR/webaudio/#audioworkletglobalscope
Comment 1 Chris Dumez 2020-10-01 16:18:32 PDT
Created attachment 410280 [details]
Patch
Comment 2 Chris Dumez 2020-10-01 18:16:08 PDT
Created attachment 410296 [details]
Patch
Comment 3 Chris Dumez 2020-10-01 18:36:41 PDT
Created attachment 410298 [details]
Patch
Comment 4 Sam Weinig 2020-10-02 10:27:23 PDT
Comment on attachment 410298 [details]
Patch

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

What's the deal with all the extra "DOM"s added to the generated code? Name conflict? Can you add an explanation to the changelog?

> Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.h:53
> +    float sampleRate() const { return 44100; }

This number should probably be in its own constexpr with a clear name to explain it (unless you expect this to go away real soon).

> Source/WebCore/Modules/webaudio/AudioWorkletProcessorConstructor.idl:31
> +]callback AudioWorkletProcessorConstructor = AudioWorkletProcessor (object options);

Please add a space after the closing ].
Comment 5 Darin Adler 2020-10-02 10:30:39 PDT
Comment on attachment 410298 [details]
Patch

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

>> Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.h:53
>> +    float sampleRate() const { return 44100; }
> 
> This number should probably be in its own constexpr with a clear name to explain it (unless you expect this to go away real soon).

If they were going to stay like this for a long time we could use static constexpr.
Comment 6 Chris Dumez 2020-10-02 10:32:40 PDT
Comment on attachment 410298 [details]
Patch

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

>>> Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.h:53
>>> +    float sampleRate() const { return 44100; }
>> 
>> This number should probably be in its own constexpr with a clear name to explain it (unless you expect this to go away real soon).
> 
> If they were going to stay like this for a long time we could use static constexpr.

This is going to go away real soon to return the actual context sample rate. I could have returned 0 here but I figured I would return a realistic sample rate.
Comment 7 Chris Dumez 2020-10-02 10:36:30 PDT
(In reply to Sam Weinig from comment #4)
> Comment on attachment 410298 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=410298&action=review
> 
> What's the deal with all the extra "DOM"s added to the generated code? Name
> conflict? Can you add an explanation to the changelog?

Yes, there was a name conflict since we now have both JSAudioWorkletProcessor and JSAudioWorkletProcessorConstructor classes (Due to having AudioWorkletProcessor.idl and AudioWorkletProcessorConstructor.idl). The issue was that the DOMConstructor for JSAudioWorkletProcessor was named JSAudioWorkletProcessorConstructor too. So I renamed it to JSAudioWorkletProcessorDOMConstructor.

> 
> > Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.h:53
> > +    float sampleRate() const { return 44100; }
> 
> This number should probably be in its own constexpr with a clear name to
> explain it (unless you expect this to go away real soon).
> 
> > Source/WebCore/Modules/webaudio/AudioWorkletProcessorConstructor.idl:31
> > +]callback AudioWorkletProcessorConstructor = AudioWorkletProcessor (object options);
> 
> Please add a space after the closing ].

Will fix.
Comment 8 Chris Dumez 2020-10-02 12:21:09 PDT
Committed r267891: <https://trac.webkit.org/changeset/267891>
Comment 9 Radar WebKit Bug Importer 2020-10-02 12:22:19 PDT
<rdar://problem/69891959>