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

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

Issue 2713793004: Add dictionary for OfflineAudioContext constructor (Closed)
Patch Set: Rebase Created 3 years, 8 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/OfflineAudioContext.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp
index b110337e3cff61227fb946f8ff824c10f16a177c..8a99df81245e5676ce500766137dd496d890725f 100644
--- a/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp
@@ -34,6 +34,7 @@
#include "modules/webaudio/AudioListener.h"
#include "modules/webaudio/DeferredTaskHandler.h"
#include "modules/webaudio/OfflineAudioCompletionEvent.h"
+#include "modules/webaudio/OfflineAudioContextOptions.h"
#include "modules/webaudio/OfflineAudioDestinationNode.h"
#include "platform/CrossThreadFunctional.h"
@@ -128,6 +129,26 @@ OfflineAudioContext* OfflineAudioContext::Create(
return audio_context;
}
+OfflineAudioContext* OfflineAudioContext::Create(
+ ExecutionContext* context,
+ const OfflineAudioContextOptions& options,
+ ExceptionState& exception_state) {
+ OfflineAudioContext* offline_context =
+ Create(context, options.hasChannelCount() ? options.channelCount() : 1,
+ options.length(), options.sampleRate(), exception_state);
+ if (offline_context) {
+ offline_context->DestinationHandler().SetChannelCountMode(
+ options.hasChannelCountMode() ? options.channelCountMode() : "explicit",
+ exception_state);
+ offline_context->DestinationHandler().SetChannelInterpretation(
+ options.hasChannelInterpretation() ? options.channelInterpretation()
+ : "speakers",
+ exception_state);
+ }
+
+ return offline_context;
+}
+
OfflineAudioContext::OfflineAudioContext(Document* document,
unsigned number_of_channels,
size_t number_of_frames,

Powered by Google App Engine
This is Rietveld 408576698