Chromium Code Reviews| Index: Source/modules/webaudio/AudioNode.cpp |
| diff --git a/Source/modules/webaudio/AudioNode.cpp b/Source/modules/webaudio/AudioNode.cpp |
| index f325bee4b7fe0be99a585a1d78a51af7652f371f..d86223af01ac5651e6a42e0a4f9d247416e8349c 100644 |
| --- a/Source/modules/webaudio/AudioNode.cpp |
| +++ b/Source/modules/webaudio/AudioNode.cpp |
| @@ -56,13 +56,8 @@ AudioNode::AudioNode(AudioContext* context, float sampleRate) |
| , m_normalRefCount(1) // start out with normal refCount == 1 (like WTF::RefCounted class) |
| #endif |
| , m_connectionRefCount(0) |
| -#if !ENABLE(OILPAN) |
| - , m_isMarkedForDeletion(false) |
| -#endif |
| , m_isDisabled(false) |
| -#if ENABLE(ASSERT) |
| - , m_didCallDispose(false) |
| -#endif |
| + , m_isDisposeCalled(false) |
| , m_channelCount(2) |
| , m_channelCountMode(Max) |
| , m_channelInterpretation(AudioBus::Speakers) |
| @@ -82,7 +77,7 @@ AudioNode::AudioNode(AudioContext* context, float sampleRate) |
| AudioNode::~AudioNode() |
| { |
| - ASSERT(m_didCallDispose); |
| + ASSERT(m_isDisposeCalled); |
| --s_instanceCount; |
| #if DEBUG_AUDIONODE_REFERENCES |
| --s_nodeCount[nodeType()]; |
| @@ -108,15 +103,18 @@ void AudioNode::dispose() |
| { |
| ASSERT(isMainThread()); |
| ASSERT(context()->isGraphOwner()); |
| + |
| + // This flag prevents: |
| + // - the following disconnectAll() from re-registering this AudioNode into the m_outputs. |
|
tkent
2014/08/14 23:25:01
I recommend to wrap code comments in 80 columns.
haraken
2014/08/15 01:27:18
Done.
|
| + // - this AudioNode from getting marked as dirty after calling unmarkDirtyNode. |
| + m_isDisposeCalled = true; |
| + |
| #if ENABLE(OILPAN) |
|
haraken
2014/08/12 14:29:51
Note: This CL depends on https://codereview.chromi
|
| context()->removeAutomaticPullNode(this); |
| for (unsigned i = 0; i < m_outputs.size(); ++i) |
| output(i)->disconnectAll(); |
| #endif |
| context()->unmarkDirtyNode(*this); |
| -#if ENABLE(ASSERT) |
| - m_didCallDispose = true; |
| -#endif |
| } |
| String AudioNode::nodeTypeName() const |
| @@ -610,7 +608,7 @@ void AudioNode::finishDeref() |
| fprintf(stderr, "%p: %d: AudioNode::deref() %d %d\n", this, nodeType(), m_normalRefCount, m_connectionRefCount); |
| #endif |
| - if (!m_normalRefCount && !m_isMarkedForDeletion) { |
| + if (!m_normalRefCount) { |
| // All references are gone - we need to go away. |
| for (unsigned i = 0; i < m_outputs.size(); ++i) |
| output(i)->disconnectAll(); // This will deref() nodes we're connected to. |
| @@ -618,7 +616,6 @@ void AudioNode::finishDeref() |
| // Mark for deletion at end of each render quantum or when context shuts |
| // down. |
| context()->markForDeletion(this); |
| - m_isMarkedForDeletion = true; |
| } |
| } |
| #endif |