Chromium Code Reviews| Index: Source/modules/webaudio/AudioNode.cpp |
| diff --git a/Source/modules/webaudio/AudioNode.cpp b/Source/modules/webaudio/AudioNode.cpp |
| index b6892a3f2a6238e5fcd1c9f50f367feff57ff15c..866c8777ae68da0ef521290cfa668c2b2f2d630f 100644 |
| --- a/Source/modules/webaudio/AudioNode.cpp |
| +++ b/Source/modules/webaudio/AudioNode.cpp |
| @@ -48,6 +48,9 @@ AudioNode::AudioNode(AudioContext* context, float sampleRate) |
| , m_nodeType(NodeTypeUnknown) |
| , m_context(context) |
| , m_sampleRate(sampleRate) |
| +#if ENABLE(OILPAN) |
| + , m_keepAlive(adoptPtr(new Persistent<AudioNode>(this))) |
| +#endif |
| , m_lastProcessingTime(-1) |
| , m_lastNonSilentTime(-1) |
| , m_normalRefCount(1) // start out with normal refCount == 1 (like WTF::RefCounted class) |
| @@ -473,6 +476,7 @@ void AudioNode::disableOutputsIfNecessary() |
| void AudioNode::ref(RefType refType) |
| { |
| + ASSERT(m_keepAlive); |
|
haraken
2014/04/08 06:02:08
Add #if ENABLE(OILPAN)
keishi
2014/04/21 17:10:11
Done.
|
| switch (refType) { |
| case RefTypeNormal: |
| atomicIncrement(&m_normalRefCount); |
| @@ -587,6 +591,19 @@ void AudioNode::printNodeCounts() |
| #endif // DEBUG_AUDIONODE_REFERENCES |
| +void AudioNode::trace(Visitor* visitor) |
| +{ |
| + visitor->trace(m_context); |
| +} |
| + |
| +#if ENABLE(OILPAN) |
| +void AudioNode::clearKeepAlive() |
| +{ |
| + ASSERT(m_keepAlive); |
| + m_keepAlive = nullptr; |
| +} |
| +#endif |
| + |
| } // namespace WebCore |
| #endif // ENABLE(WEB_AUDIO) |