Bug 217059 - Add stubs for AudioWorklet
Summary: Add stubs for AudioWorklet
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: https://www.w3.org/TR/webaudio/#audio...
Keywords: InRadar
Depends on:
Blocks: 217058
  Show dependency treegraph
 
Reported: 2020-09-28 11:22 PDT by Chris Dumez
Modified: 2020-10-13 13:30 PDT (History)
18 users (show)

See Also:


Attachments
Patch (166.89 KB, patch)
2020-09-28 18:10 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (166.95 KB, patch)
2020-09-28 18:23 PDT, Chris Dumez
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (167.17 KB, patch)
2020-09-28 18:41 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (167.34 KB, patch)
2020-09-28 18:43 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (168.00 KB, patch)
2020-09-28 19:35 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (168.02 KB, patch)
2020-09-29 08:35 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (164.65 KB, patch)
2020-09-29 08:38 PDT, Chris Dumez
no flags 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-09-28 11:22:36 PDT
Add stubs for AudioWorklet:
- https://www.w3.org/TR/webaudio/#audioworklet
Comment 1 Chris Dumez 2020-09-28 18:10:20 PDT
Created attachment 409936 [details]
Patch
Comment 2 Chris Dumez 2020-09-28 18:23:11 PDT
Created attachment 409937 [details]
Patch
Comment 3 Chris Dumez 2020-09-28 18:41:15 PDT
Created attachment 409942 [details]
Patch
Comment 4 Chris Dumez 2020-09-28 18:43:48 PDT
Created attachment 409944 [details]
Patch
Comment 5 Chris Dumez 2020-09-28 19:35:49 PDT
Created attachment 409953 [details]
Patch
Comment 6 Eric Carlson 2020-09-28 19:43:33 PDT
Comment on attachment 409953 [details]
Patch

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

> Source/WebCore/css/DOMCSSPaintWorklet.cpp:76
> +void PaintWorklet::addModule(Document& document, const String& moduleURL, WorkletOptions&&, DOMPromiseDeferred<void>&& promise)
> +{
> +    // FIXME: We should download the source from the URL
> +    // https://bugs.webkit.org/show_bug.cgi?id=191136
> +    auto maybeContext = PaintWorkletGlobalScope::tryCreate(document, ScriptSourceCode(moduleURL));
> +    if (UNLIKELY(!maybeContext)) {
> +        promise.reject(Exception { OutOfMemoryError });
> +        return;
> +    }
> +    auto context = maybeContext.releaseNonNull();
> +    context->evaluate();
> +
> +    auto locker = holdLock(context->paintDefinitionLock());
> +    for (auto& name : context->paintDefinitionMap().keys())
> +        document.setPaintWorkletGlobalScopeForName(name, makeRef(context.get()));
> +    promise.resolve();
> +}
> +

Did you mean to include PaintWorklet changes in this patch?
Comment 7 Chris Dumez 2020-09-28 19:45:45 PDT
(In reply to Eric Carlson from comment #6)
> Comment on attachment 409953 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=409953&action=review
> 
> > Source/WebCore/css/DOMCSSPaintWorklet.cpp:76
> > +void PaintWorklet::addModule(Document& document, const String& moduleURL, WorkletOptions&&, DOMPromiseDeferred<void>&& promise)
> > +{
> > +    // FIXME: We should download the source from the URL
> > +    // https://bugs.webkit.org/show_bug.cgi?id=191136
> > +    auto maybeContext = PaintWorkletGlobalScope::tryCreate(document, ScriptSourceCode(moduleURL));
> > +    if (UNLIKELY(!maybeContext)) {
> > +        promise.reject(Exception { OutOfMemoryError });
> > +        return;
> > +    }
> > +    auto context = maybeContext.releaseNonNull();
> > +    context->evaluate();
> > +
> > +    auto locker = holdLock(context->paintDefinitionLock());
> > +    for (auto& name : context->paintDefinitionMap().keys())
> > +        document.setPaintWorkletGlobalScopeForName(name, makeRef(context.get()));
> > +    promise.resolve();
> > +}
> > +
> 
> Did you mean to include PaintWorklet changes in this patch?

Yes, I moved paint Worklet specific code out of the generic Worklet code and to a PaintWorklet subclass.
Comment 8 Chris Dumez 2020-09-29 08:35:24 PDT
Created attachment 410003 [details]
Patch
Comment 9 Chris Dumez 2020-09-29 08:38:41 PDT
Created attachment 410004 [details]
Patch
Comment 10 EWS 2020-09-29 09:47:45 PDT
Committed r267744: <https://trac.webkit.org/changeset/267744>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 410004 [details].
Comment 11 Radar WebKit Bug Importer 2020-09-29 09:48:25 PDT
<rdar://problem/69751498>