| Index: Source/modules/webaudio/AudioNode.cpp
|
| diff --git a/Source/modules/webaudio/AudioNode.cpp b/Source/modules/webaudio/AudioNode.cpp
|
| index b6892a3f2a6238e5fcd1c9f50f367feff57ff15c..2f2a6be19a53ffaa17e7dc62a056968d084a4714 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)
|
| @@ -140,7 +143,7 @@ void AudioNode::setNodeType(NodeType type)
|
| #endif
|
| }
|
|
|
| -void AudioNode::addInput(PassOwnPtr<AudioNodeInput> input)
|
| +void AudioNode::addInput(PassOwnPtrWillBeRawPtr<AudioNodeInput> input)
|
| {
|
| m_inputs.append(input);
|
| }
|
| @@ -473,6 +476,9 @@ void AudioNode::disableOutputsIfNecessary()
|
|
|
| void AudioNode::ref(RefType refType)
|
| {
|
| +#if ENABLE(OILPAN)
|
| + ASSERT(m_keepAlive);
|
| +#endif
|
| switch (refType) {
|
| case RefTypeNormal:
|
| atomicIncrement(&m_normalRefCount);
|
| @@ -587,6 +593,25 @@ void AudioNode::printNodeCounts()
|
|
|
| #endif // DEBUG_AUDIONODE_REFERENCES
|
|
|
| +void AudioNode::trace(Visitor* visitor)
|
| +{
|
| + visitor->trace(m_context);
|
| + visitor->trace(m_inputs);
|
| +}
|
| +
|
| +#if ENABLE(OILPAN)
|
| +void AudioNode::clearKeepAlive()
|
| +{
|
| + // It is safe to drop the self-persistent when the ref count
|
| + // of a AudioNode reaches zero. At that point, the
|
| + // AudioNode node is removed from the AudioContext and
|
| + // it cannot be reattached. Therefore, the reference count
|
| + // will not go above zero again.
|
| + ASSERT(m_keepAlive);
|
| + m_keepAlive = nullptr;
|
| +}
|
| +#endif
|
| +
|
| } // namespace WebCore
|
|
|
| #endif // ENABLE(WEB_AUDIO)
|
|
|