Bug 217194

Summary: Add stubs for AudioWorkletProcessor and AudioWorkletGlobalScope
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Web AudioAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: alecflett, annulen, beidson, darin, eric.carlson, esprehn+autocc, ews-watchlist, ggaren, glenn, gyuyoung.kim, jer.noble, jsbell, kondapallykalyan, philipj, ryuan.choi, sam, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 217153    
Bug Blocks: 217058, 217242    
Attachments:
Description Flags
Patch
none
Patch
ews-feeder: commit-queue-
Patch sam: review+

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>