Bug 214994 - Add OfflineAudioCompletionEvent constructor
Summary: Add OfflineAudioCompletionEvent constructor
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/#Offli...
Keywords: InRadar
Depends on:
Blocks: 212611
  Show dependency treegraph
 
Reported: 2020-07-30 15:59 PDT by Chris Dumez
Modified: 2020-07-31 16:42 PDT (History)
16 users (show)

See Also:


Attachments
Patch (18.73 KB, patch)
2020-07-30 16:40 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (24.88 KB, patch)
2020-07-31 10:34 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (23.89 KB, patch)
2020-07-31 15:45 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-07-30 15:59:51 PDT
Add OfflineAudioCompletionEvent constructor:
https://www.w3.org/TR/webaudio/#OfflineAudioCompletionEvent
Comment 1 Chris Dumez 2020-07-30 16:40:47 PDT
Created attachment 405634 [details]
Patch
Comment 2 youenn fablet 2020-07-31 03:01:10 PDT
Comment on attachment 405634 [details]
Patch

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

> Source/WebCore/Modules/webaudio/OfflineAudioCompletionEvent.cpp:57
> +    , m_renderedBuffer(WTFMove(init.renderedBuffer))

This is a pre-existing issue but it seems that m_renderedBuffer should be a Ref<> since it cannot be null.
Looking at the other OfflineAudioCompletionEvent::create, it seems it should be OfflineAudioCompletionEvent::create(Ref<AudioBuffer>&&) as well.

> Source/WebCore/Modules/webaudio/OfflineAudioCompletionEvent.h:29
> +#include "OfflineAudioCompletionEventInit.h"

Can we forward declare OfflineAudioCompletionEventInit instead?

> Source/WebCore/Modules/webaudio/OfflineAudioCompletionEvent.h:30
>  #include <wtf/RefPtr.h>

Might not be needed?

> Source/WebCore/Modules/webaudio/OfflineAudioCompletionEventInit.h:33
> +    RefPtr<AudioBuffer> renderedBuffer;

Would be nice if we could make it a Ref<>. I guess this is a binding generator limitation?
Maybe we can actually do it now that Ref is copyable.

> LayoutTests/imported/w3c/web-platform-tests/webaudio/idlharness.https.window-expected.txt:163
> +PASS OfflineAudioCompletionEvent interface object length 

Do we have enough test coverage?
Can we make sure we have tests creating OfflineAudioCompletionEvent from JS?
Comment 3 Chris Dumez 2020-07-31 09:25:59 PDT
Comment on attachment 405634 [details]
Patch

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

>> Source/WebCore/Modules/webaudio/OfflineAudioCompletionEventInit.h:33
>> +    RefPtr<AudioBuffer> renderedBuffer;
> 
> Would be nice if we could make it a Ref<>. I guess this is a binding generator limitation?
> Maybe we can actually do it now that Ref is copyable.

This is a bindings generator limitation, sadly.
Comment 4 Chris Dumez 2020-07-31 10:34:30 PDT
Created attachment 405706 [details]
Patch
Comment 5 EWS 2020-07-31 15:22:40 PDT
Tools/Scripts/svn-apply failed to apply attachment 405706 [details] to trunk.
Please resolve the conflicts and upload a new patch.
Comment 6 Chris Dumez 2020-07-31 15:45:54 PDT
Created attachment 405752 [details]
Patch
Comment 7 EWS 2020-07-31 16:41:44 PDT
Committed r265168: <https://trac.webkit.org/changeset/265168>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 405752 [details].
Comment 8 Radar WebKit Bug Importer 2020-07-31 16:42:20 PDT
<rdar://problem/66404787>