Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 38 | 38 |
| 39 AudioBasicProcessorNode::AudioBasicProcessorNode(AudioContext* context, float sa mpleRate) | 39 AudioBasicProcessorNode::AudioBasicProcessorNode(AudioContext* context, float sa mpleRate) |
| 40 : AudioNode(context, sampleRate) | 40 : AudioNode(context, sampleRate) |
| 41 { | 41 { |
| 42 addInput(); | 42 addInput(); |
| 43 addOutput(AudioNodeOutput::create(this, 1)); | 43 addOutput(AudioNodeOutput::create(this, 1)); |
| 44 | 44 |
| 45 // The subclass must create m_processor. | 45 // The subclass must create m_processor. |
| 46 } | 46 } |
| 47 | 47 |
| 48 void AudioBasicProcessorNode::trace(Visitor* visitor) | |
| 49 { | |
| 50 visitor->trace(m_processor); | |
| 51 AudioNode::trace(visitor); | |
| 52 } | |
| 53 | |
| 48 void AudioBasicProcessorNode::initialize() | 54 void AudioBasicProcessorNode::initialize() |
| 49 { | 55 { |
| 50 if (isInitialized()) | 56 if (isInitialized()) |
| 51 return; | 57 return; |
| 52 | 58 |
| 53 ASSERT(processor()); | 59 ASSERT(processor()); |
| 54 processor()->initialize(); | 60 processor()->initialize(); |
| 55 | 61 |
| 56 AudioNode::initialize(); | 62 AudioNode::initialize(); |
| 57 } | 63 } |
| 58 | 64 |
| 59 void AudioBasicProcessorNode::uninitialize() | 65 void AudioBasicProcessorNode::uninitialize() |
|
haraken
2014/07/23 03:09:49
Hmm, this looks safe but fragile.
uninitialize()
tkent
2014/07/23 03:38:41
I'll add ~AudioBasicProcessorNode with ASSERT(!isI
haraken
2014/07/23 03:41:03
That's a nice idea.
| |
| 60 { | 66 { |
| 61 if (!isInitialized()) | 67 if (!isInitialized()) |
| 62 return; | 68 return; |
| 63 | 69 |
| 64 ASSERT(processor()); | 70 ASSERT(processor()); |
| 65 processor()->uninitialize(); | 71 processor()->uninitialize(); |
| 66 | 72 |
| 67 AudioNode::uninitialize(); | 73 AudioNode::uninitialize(); |
| 68 } | 74 } |
| 69 | 75 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 136 } | 142 } |
| 137 | 143 |
| 138 double AudioBasicProcessorNode::latencyTime() const | 144 double AudioBasicProcessorNode::latencyTime() const |
| 139 { | 145 { |
| 140 return m_processor->latencyTime(); | 146 return m_processor->latencyTime(); |
| 141 } | 147 } |
| 142 | 148 |
| 143 } // namespace blink | 149 } // namespace blink |
| 144 | 150 |
| 145 #endif // ENABLE(WEB_AUDIO) | 151 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |