Commit 6f506392 authored by haraken@chromium.org's avatar haraken@chromium.org

Remove AudioNode::isMarkedForDeletion from oilpan builds

AudioNode::isMarkedForDeletion is not needed any more in oilpan builds
for the following (non-trivial) reason:

0 isMarkedForDeletion is set to true in AudioNode::dispose().
In oilpan builds, AudioNode::dispose() is called after the AudioNode
becomes unreachable. In other words, isMarkedForDeletion is set to true
after the AudioNode becomes unreachable.

- The only user of isMarkedForDeletion is AudioNodeInput::canUpdateState().
AudioNodeInput::canUpdateState() returns false if isMarkedForDeletion is true.

- AudioNodeInput has a strong reference to the AudioNode.

These facts indicate that AudioNodeInput::canUpdateState() always returns true. Thus this CL removes the canUpdateState() checks from the code base. This also enables us to remove AudioNode::isMarkedForDeletion.

BUG=340522
NOTRY=true

Review URL: https://codereview.chromium.org/458923003

git-svn-id: svn://svn.chromium.org/blink/trunk@180032 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 0899b916
......@@ -56,7 +56,9 @@ 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)
......@@ -110,7 +112,6 @@ void AudioNode::dispose()
context()->removeAutomaticPullNode(this);
for (unsigned i = 0; i < m_outputs.size(); ++i)
output(i)->disconnectAll();
m_isMarkedForDeletion = true;
#endif
context()->unmarkDirtyNode(*this);
#if ENABLE(ASSERT)
......
......@@ -158,7 +158,9 @@ public:
static void printNodeCounts();
#endif
#if !ENABLE(OILPAN)
bool isMarkedForDeletion() const { return m_isMarkedForDeletion; }
#endif
// tailTime() is the length of time (not counting latency time) where non-zero output may occur after continuous silent input.
virtual double tailTime() const = 0;
......@@ -225,7 +227,9 @@ private:
#endif
volatile int m_connectionRefCount;
#if !ENABLE(OILPAN)
bool m_isMarkedForDeletion;
#endif
bool m_isDisabled;
#if ENABLE(ASSERT)
......
......@@ -45,7 +45,9 @@ public:
// AudioSummingJunction
virtual void trace(Visitor*) OVERRIDE;
#if !ENABLE(OILPAN)
virtual bool canUpdateState() OVERRIDE { return !node().isMarkedForDeletion(); }
#endif
virtual void didUpdate() OVERRIDE;
// Can be called from any thread.
......
......@@ -59,7 +59,9 @@ public:
}
// AudioSummingJunction
#if !ENABLE(OILPAN)
virtual bool canUpdateState() OVERRIDE { return true; }
#endif
virtual void didUpdate() OVERRIDE { }
// Intrinsic value.
......
......@@ -60,7 +60,11 @@ void AudioSummingJunction::trace(Visitor* visitor)
void AudioSummingJunction::changedOutputs()
{
ASSERT(context()->isGraphOwner());
#if ENABLE(OILPAN)
if (!m_renderingStateNeedUpdating) {
#else
if (!m_renderingStateNeedUpdating && canUpdateState()) {
#endif
context()->markSummingJunctionDirty(this);
m_renderingStateNeedUpdating = true;
}
......@@ -69,8 +73,11 @@ void AudioSummingJunction::changedOutputs()
void AudioSummingJunction::updateRenderingState()
{
ASSERT(context()->isAudioThread() && context()->isGraphOwner());
#if ENABLE(OILPAN)
if (m_renderingStateNeedUpdating) {
#else
if (m_renderingStateNeedUpdating && canUpdateState()) {
#endif
// Copy from m_outputs to m_renderingOutputs.
m_renderingOutputs.resize(m_outputs.size());
unsigned j = 0;
......
......@@ -57,7 +57,9 @@ public:
AudioNodeOutput* renderingOutput(unsigned i) { return m_renderingOutputs[i]; }
bool isConnected() const { return numberOfRenderingConnections() > 0; }
#if !ENABLE(OILPAN)
virtual bool canUpdateState() = 0;
#endif
virtual void didUpdate() = 0;
protected:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment