Index: third_party/WebKit/Source/modules/webaudio/IIRFilterNode.cpp |
diff --git a/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.cpp b/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.cpp |
index 38bf3bcb481863a13eeaa88f52b683381e95f858..e32182f3da18f51f5503d7c323b7d5c553604fd7 100644 |
--- a/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.cpp |
+++ b/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.cpp |
@@ -9,6 +9,7 @@ |
#include "core/dom/ExceptionCode.h" |
#include "modules/webaudio/AudioBasicProcessorHandler.h" |
#include "modules/webaudio/BaseAudioContext.h" |
+#include "modules/webaudio/IIRFilterOptions.h" |
#include "platform/Histogram.h" |
#include "wtf/PtrUtil.h" |
@@ -117,6 +118,31 @@ IIRFilterNode* IIRFilterNode::create( |
return new IIRFilterNode(context, feedforwardCoef, feedbackCoef); |
} |
+IIRFilterNode* IIRFilterNode::create( |
+ BaseAudioContext* context, |
+ const IIRFilterOptions& options, |
+ ExceptionState& exceptionState) |
+{ |
+ if (!options.hasFeedforward()) { |
+ exceptionState.throwDOMException( |
+ NotFoundError, |
+ "IIRFilterOptions: feedforward is required."); |
+ return nullptr; |
+ } |
+ |
+ if (!options.hasFeedback()) { |
+ exceptionState.throwDOMException( |
+ NotFoundError, |
+ "IIRFilterOptions: feedback is required."); |
+ return nullptr; |
+ } |
+ |
+ IIRFilterNode* node = create(*context, options.feedforward(), options.feedback(), exceptionState); |
haraken
2016/09/13 00:13:21
You need to check if(!node).
Raymond Toy
2016/09/13 15:44:57
Done.
|
+ node->handleChannelOptions(options, exceptionState); |
+ |
+ return node; |
+} |
+ |
DEFINE_TRACE(IIRFilterNode) |
{ |
AudioNode::trace(visitor); |