Chromium Code Reviews| Index: Source/modules/webaudio/AudioBufferSourceNode.cpp |
| diff --git a/Source/modules/webaudio/AudioBufferSourceNode.cpp b/Source/modules/webaudio/AudioBufferSourceNode.cpp |
| index 77d37af96f0cd98dec176ddae49a51558765e494..714eb9f0385e3cfb70a1a5c7d37973837bd451e9 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."); |
|
hongchan
2015/01/16 23:42:09
Perhaps the first word should be capitalized? Othe
Raymond Toy
2015/01/17 00:03:16
Will do. And get rid of the trailing period.
Raymond Toy
2015/01/20 18:06:00
Done.
|
| + return; |
| + } |
| + |
| // The context must be locked since changing the buffer can re-configure the number of channels that are output. |
| AudioContext::AutoLocker contextLocker(context()); |