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

Unified Diff: third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp

Issue 2092033003: Add OfflineAudioDestinationNode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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: third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp b/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
index e5042117c0f7b54b8b426113049dcd9a7cc06840..e0501cd6820662207732e3e95546c768f5a9b7fc 100644
--- a/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
@@ -24,6 +24,8 @@
#include "modules/webaudio/OfflineAudioDestinationNode.h"
+#include "core/dom/ExceptionCode.h"
+#include "core/dom/ExecutionContext.h"
#include "core/dom/ExecutionContextTask.h"
#include "modules/webaudio/AudioNodeInput.h"
#include "modules/webaudio/AudioNodeOutput.h"
@@ -313,6 +315,40 @@ bool OfflineAudioDestinationHandler::renderIfNotSuspended(AudioBus* sourceBus, A
return false;
}
+void OfflineAudioDestinationHandler::setChannelCount(unsigned long newChannelCount, ExceptionState& exceptionState)
+{
+ DCHECK(isMainThread());
+ BaseAudioContext::AutoLocker locker(context());
+
+ // Cannot change the channelCount to a different value.
+ if (newChannelCount != channelCount()) {
+ exceptionState.throwDOMException(
+ NotSupportedError,
+ ExceptionMessages::indexOutsideRange<unsigned long>(
+ "channelCount",
+ newChannelCount,
+ channelCount(),
+ ExceptionMessages::InclusiveBound,
+ channelCount(),
+ ExceptionMessages::InclusiveBound));
+ }
+}
+
+void OfflineAudioDestinationHandler::setChannelCountMode(const String& mode, ExceptionState& exceptionState)
+{
+ DCHECK(isMainThread());
+ BaseAudioContext::AutoLocker locker(context());
+
+ if (mode != channelCountMode()) {
+ exceptionState.throwDOMException(
+ NotSupportedError,
+ "Cannot change channelCountMode from \""
+ + channelCountMode()
+ + "\" to \""
+ + mode + "\"");
+ }
+}
+
// ----------------------------------------------------------------
OfflineAudioDestinationNode::OfflineAudioDestinationNode(BaseAudioContext& context, AudioBuffer* renderTarget)

Powered by Google App Engine
This is Rietveld 408576698