Chromium Code Reviews| Index: Source/modules/webaudio/AudioBufferSourceNode.cpp |
| diff --git a/Source/modules/webaudio/AudioBufferSourceNode.cpp b/Source/modules/webaudio/AudioBufferSourceNode.cpp |
| index 5d40b0ae4c8941d76df1b7548b4005c980e23d54..f012779991e9a4a7d5d53239c6b3ccd782be4cd6 100644 |
| --- a/Source/modules/webaudio/AudioBufferSourceNode.cpp |
| +++ b/Source/modules/webaudio/AudioBufferSourceNode.cpp |
| @@ -340,6 +340,13 @@ void AudioBufferSourceNode::setBuffer(AudioBuffer* buffer, ExceptionState& excep |
| { |
| ASSERT(isMainThread()); |
| + if (m_buffer) { |
| + exceptionState.throwDOMException( |
| + InvalidStateError, |
| + "Buffer can only be set once"); |
| + return; |
| + } |
| + |
| // The context must be locked since changing the buffer can re-configure the number of channels that are output. |
|
Ken Russell (switch to Gerrit)
2015/01/20 21:26:16
This comment, and probably later ones, should be u
Raymond Toy
2015/01/20 21:35:03
I believe this is still true. On creation without
|
| AudioContext::AutoLocker contextLocker(context()); |