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

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: Capitalize buffer 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
« no previous file with comments | « LayoutTests/webaudio/dom-exceptions-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « LayoutTests/webaudio/dom-exceptions-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698