Chromium Code Reviews| Index: third_party/WebKit/Source/modules/webaudio/GainNode.cpp |
| diff --git a/third_party/WebKit/Source/modules/webaudio/GainNode.cpp b/third_party/WebKit/Source/modules/webaudio/GainNode.cpp |
| index 190e61a54f713778a7dcb6c924c56d9dbe1af6c0..e17710c7d4978c53795d6dc7f764da2aceee692b 100644 |
| --- a/third_party/WebKit/Source/modules/webaudio/GainNode.cpp |
| +++ b/third_party/WebKit/Source/modules/webaudio/GainNode.cpp |
| @@ -25,6 +25,7 @@ |
| #include "modules/webaudio/GainNode.h" |
| #include "modules/webaudio/AudioNodeInput.h" |
| #include "modules/webaudio/AudioNodeOutput.h" |
| +#include "modules/webaudio/GainOptions.h" |
| #include "platform/audio/AudioBus.h" |
| namespace blink { |
| @@ -138,6 +139,21 @@ GainNode* GainNode::create(BaseAudioContext& context, ExceptionState& exceptionS |
| return new GainNode(context); |
| } |
| +GainNode* GainNode::create(BaseAudioContext* context, const GainOptions& options, ExceptionState& exceptionState) |
| +{ |
| + GainNode* node = create(*context, exceptionState); |
| + |
| + if (!node) |
| + return node; |
|
hongchan
2016/09/12 18:56:32
return nullptr;
|
| + |
| + node->handleChannelOptions(options, exceptionState); |
| + |
| + if (options.hasGain()) |
| + node->gain()->setValue(options.gain()); |
| + |
| + return node; |
| +} |
| + |
| AudioParam* GainNode::gain() const |
| { |
| return m_gain; |