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 6c8ad44f22c19bbfa9e88346b24fbcc099cf33ab..2e4d2f35b379286c81b7a0745cd924b6e0efcb96 100644 |
| --- a/third_party/WebKit/Source/modules/webaudio/GainNode.cpp |
| +++ b/third_party/WebKit/Source/modules/webaudio/GainNode.cpp |
| @@ -114,16 +114,23 @@ void GainHandler::checkNumberOfChannelsForInput(AudioNodeInput* input) |
| // ---------------------------------------------------------------- |
| -GainNode::GainNode(AbstractAudioContext& context, float sampleRate) |
| +GainNode::GainNode(AbstractAudioContext& context) |
| : AudioNode(context) |
| , m_gain(AudioParam::create(context, ParamTypeGainGain, 1.0)) |
| { |
| - setHandler(GainHandler::create(*this, sampleRate, m_gain->handler())); |
| + setHandler(GainHandler::create(*this, context.sampleRate(), m_gain->handler())); |
| } |
| -GainNode* GainNode::create(AbstractAudioContext& context, float sampleRate) |
| +GainNode* GainNode::create(AbstractAudioContext& context, ExceptionState& exceptionState) |
| { |
| - return new GainNode(context, sampleRate); |
| + ASSERT(isMainThread()); |
|
hongchan
2016/05/13 01:20:12
DCHECK.
Raymond Toy
2016/05/20 23:12:00
Done.
|
| + |
| + if (context.isContextClosed()) { |
| + context.throwExceptionForClosedState(exceptionState); |
| + return nullptr; |
| + } |
| + |
| + return new GainNode(context); |
| } |
| AudioParam* GainNode::gain() const |