Bug 215510

Summary: AudioBufferSourceNode.buffer setter should throw when the buffer was already set
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Web AudioAssignee: Chris Dumez <cdumez>
Severity: Normal CC: clark_wang, darin, eric.carlson, ews-watchlist, ggaren, glenn, jer.noble, philipj, sergio, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
URL: https://www.w3.org/TR/webaudio/#dom-audiobuffersourcenode-buffer
Bug Depends on:    
Bug Blocks: 212611    
Description Flags
Patch none

Description Chris Dumez 2020-08-14 10:00:19 PDT
AudioBufferSourceNode.buffer setter should throw when the buffer was already set:
- https://www.w3.org/TR/webaudio/#dom-audiobuffersourcenode-buffer
Comment 1 Chris Dumez 2020-08-14 10:02:57 PDT
Created attachment 406599 [details]
Comment 2 Darin Adler 2020-08-14 10:46:17 PDT
Comment on attachment 406599 [details]

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

> Source/WebCore/Modules/webaudio/AudioBufferSourceNode.h:55
>      // returns true on success.

This comment seems wrong.

> Source/WebCore/Modules/webaudio/AudioBufferSourceNode.h:101
> +    virtual bool isWebKitAudioBufferSourceNode() const { return false; }

This is a little ugly. I guess it’s how we do dynamic type checks, but I could imagine this being a policy function — "can set buffer twice" or whatever — rather than a type check function.
Comment 3 Chris Dumez 2020-08-14 10:52:15 PDT
Created attachment 406608 [details]
Comment 4 EWS 2020-08-14 11:19:46 PDT
Committed r265681: <https://trac.webkit.org/changeset/265681>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 406608 [details].
Comment 5 Radar WebKit Bug Importer 2020-08-14 11:20:39 PDT