Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2281)

Unified Diff: Source/modules/webaudio/AudioBufferSourceNode.cpp

Issue 825603005: AudioBufferSourceNode.buffer can only be set once. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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());

Powered by Google App Engine
This is Rietveld 408576698