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

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: Use deprecation message instead of DOM error 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
« Source/core/frame/UseCounter.cpp ('K') | « Source/core/frame/UseCounter.cpp ('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..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());
« Source/core/frame/UseCounter.cpp ('K') | « Source/core/frame/UseCounter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698