Index: Source/modules/webaudio/AudioBufferSourceNode.cpp |
diff --git a/Source/modules/webaudio/AudioBufferSourceNode.cpp b/Source/modules/webaudio/AudioBufferSourceNode.cpp |
index 5d40b0ae4c8941d76df1b7548b4005c980e23d54..1d98047e14eb1a91985e17c3ed718e365e515c4f 100644 |
--- a/Source/modules/webaudio/AudioBufferSourceNode.cpp |
+++ b/Source/modules/webaudio/AudioBufferSourceNode.cpp |
@@ -30,6 +30,7 @@ |
#include "bindings/core/v8/ExceptionState.h" |
#include "core/dom/ExceptionCode.h" |
+#include "core/frame/UseCounter.h" |
#include "platform/audio/AudioUtilities.h" |
#include "modules/webaudio/AudioContext.h" |
#include "modules/webaudio/AudioNodeOutput.h" |
@@ -340,6 +341,12 @@ void AudioBufferSourceNode::setBuffer(AudioBuffer* buffer, ExceptionState& excep |
{ |
ASSERT(isMainThread()); |
+ if (m_buffer) { |
+ // Setting the buffer more than once is deprecated. Change this to a DOM exception in M45 |
+ // or so. |
+ UseCounter::countDeprecation(context()->executionContext(), UseCounter::AudioBufferSourceBufferOnce); |
+ } |
+ |
// The context must be locked since changing the buffer can re-configure the number of channels that are output. |
AudioContext::AutoLocker contextLocker(context()); |