Bug 217405

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

Description Chris Dumez 2020-10-06 14:03:18 PDT
Add implementation for AudioWorkletGlobalScope.registerProcessor():
- https://www.w3.org/TR/webaudio/#dom-audioworkletglobalscope-registerprocessor
Comment 1 Chris Dumez 2020-10-06 14:25:15 PDT
Created attachment 410693 [details]
Patch
Comment 2 Geoffrey Garen 2020-10-06 15:21:54 PDT
Comment on attachment 410693 [details]
Patch

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

r=me

> Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.cpp:70
> +    JSC::JSObject* jsConstructor = processorContructor->callbackData()->callback();
> +    auto* globalObject = jsConstructor->globalObject();
> +    auto& vm = globalObject->vm();
> +    auto scope = DECLARE_THROW_SCOPE(vm);

Does an audio worklet always execute on the same non-main thread?
Comment 3 Chris Dumez 2020-10-06 15:22:42 PDT
(In reply to Geoffrey Garen from comment #2)
> Comment on attachment 410693 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=410693&action=review
> 
> r=me
> 
> > Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.cpp:70
> > +    JSC::JSObject* jsConstructor = processorContructor->callbackData()->callback();
> > +    auto* globalObject = jsConstructor->globalObject();
> > +    auto& vm = globalObject->vm();
> > +    auto scope = DECLARE_THROW_SCOPE(vm);
> 
> Does an audio worklet always execute on the same non-main thread?

Yes it does.
Comment 4 Chris Dumez 2020-10-06 15:25:46 PDT
(In reply to Chris Dumez from comment #3)
> (In reply to Geoffrey Garen from comment #2)
> > Comment on attachment 410693 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=410693&action=review
> > 
> > r=me
> > 
> > > Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.cpp:70
> > > +    JSC::JSObject* jsConstructor = processorContructor->callbackData()->callback();
> > > +    auto* globalObject = jsConstructor->globalObject();
> > > +    auto& vm = globalObject->vm();
> > > +    auto scope = DECLARE_THROW_SCOPE(vm);
> > 
> > Does an audio worklet always execute on the same non-main thread?
> 
> Yes it does.

Why the question? Would you like me to tighten the assertion to make sure we're always running on the Worklet thread instead of simply checking we're not on the main thread?
Comment 5 Chris Dumez 2020-10-06 15:51:48 PDT
Created attachment 410707 [details]
Patch
Comment 6 Chris Dumez 2020-10-06 15:53:16 PDT
Created attachment 410708 [details]
Patch
Comment 7 Chris Dumez 2020-10-06 16:12:04 PDT
Created attachment 410710 [details]
Patch
Comment 8 EWS 2020-10-06 16:47:35 PDT
ChangeLog entry in LayoutTests/imported/w3c/ChangeLog contains OOPS!.
Comment 9 Chris Dumez 2020-10-06 16:54:04 PDT
Created attachment 410713 [details]
Patch
Comment 10 EWS 2020-10-06 17:36:26 PDT
Committed r268103: <https://trac.webkit.org/changeset/268103>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 410713 [details].
Comment 11 Radar WebKit Bug Importer 2020-10-06 17:37:25 PDT
<rdar://problem/70025532>