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) ...@@ -56,7 +56,9 @@ AudioNode::AudioNode(AudioContext* context, float sampleRate)
, m_normalRefCount(1) // start out with normal refCount == 1 (like WTF::RefCounted class) , m_normalRefCount(1) // start out with normal refCount == 1 (like WTF::RefCounted class)
#endif #endif
, m_connectionRefCount(0) , m_connectionRefCount(0)
#if !ENABLE(OILPAN)
, m_isMarkedForDeletion(false) , m_isMarkedForDeletion(false)
#endif
, m_isDisabled(false) , m_isDisabled(false)
#if ENABLE(ASSERT) #if ENABLE(ASSERT)
, m_didCallDispose(false) , m_didCallDispose(false)
...@@ -110,7 +112,6 @@ void AudioNode::dispose() ...@@ -110,7 +112,6 @@ void AudioNode::dispose()
context()->removeAutomaticPullNode(this); context()->removeAutomaticPullNode(this);
for (unsigned i = 0; i < m_outputs.size(); ++i) for (unsigned i = 0; i < m_outputs.size(); ++i)
output(i)->disconnectAll(); output(i)->disconnectAll();
m_isMarkedForDeletion = true;
#endif #endif
context()->unmarkDirtyNode(*this); context()->unmarkDirtyNode(*this);
#if ENABLE(ASSERT) #if ENABLE(ASSERT)
......
...@@ -158,7 +158,9 @@ public: ...@@ -158,7 +158,9 @@ public:
static void printNodeCounts(); static void printNodeCounts();
#endif #endif
#if !ENABLE(OILPAN)
bool isMarkedForDeletion() const { return m_isMarkedForDeletion; } 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. // 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; virtual double tailTime() const = 0;
...@@ -225,7 +227,9 @@ private: ...@@ -225,7 +227,9 @@ private:
#endif #endif
volatile int m_connectionRefCount; volatile int m_connectionRefCount;
#if !ENABLE(OILPAN)
bool m_isMarkedForDeletion; bool m_isMarkedForDeletion;
#endif
bool m_isDisabled; bool m_isDisabled;
#if ENABLE(ASSERT) #if ENABLE(ASSERT)
......
...@@ -45,7 +45,9 @@ public: ...@@ -45,7 +45,9 @@ public:
// AudioSummingJunction // AudioSummingJunction
virtual void trace(Visitor*) OVERRIDE; virtual void trace(Visitor*) OVERRIDE;
#if !ENABLE(OILPAN)
virtual bool canUpdateState() OVERRIDE { return !node().isMarkedForDeletion(); } virtual bool canUpdateState() OVERRIDE { return !node().isMarkedForDeletion(); }
#endif
virtual void didUpdate() OVERRIDE; virtual void didUpdate() OVERRIDE;
// Can be called from any thread. // Can be called from any thread.
......
...@@ -59,7 +59,9 @@ public: ...@@ -59,7 +59,9 @@ public:
} }
// AudioSummingJunction // AudioSummingJunction
#if !ENABLE(OILPAN)
virtual bool canUpdateState() OVERRIDE { return true; } virtual bool canUpdateState() OVERRIDE { return true; }
#endif
virtual void didUpdate() OVERRIDE { } virtual void didUpdate() OVERRIDE { }
// Intrinsic value. // Intrinsic value.
......
...@@ -60,7 +60,11 @@ void AudioSummingJunction::trace(Visitor* visitor) ...@@ -60,7 +60,11 @@ void AudioSummingJunction::trace(Visitor* visitor)
void AudioSummingJunction::changedOutputs() void AudioSummingJunction::changedOutputs()
{ {
ASSERT(context()->isGraphOwner()); ASSERT(context()->isGraphOwner());
#if ENABLE(OILPAN)
if (!m_renderingStateNeedUpdating) {
#else
if (!m_renderingStateNeedUpdating && canUpdateState()) { if (!m_renderingStateNeedUpdating && canUpdateState()) {
#endif
context()->markSummingJunctionDirty(this); context()->markSummingJunctionDirty(this);
m_renderingStateNeedUpdating = true; m_renderingStateNeedUpdating = true;
} }
...@@ -69,8 +73,11 @@ void AudioSummingJunction::changedOutputs() ...@@ -69,8 +73,11 @@ void AudioSummingJunction::changedOutputs()
void AudioSummingJunction::updateRenderingState() void AudioSummingJunction::updateRenderingState()
{ {
ASSERT(context()->isAudioThread() && context()->isGraphOwner()); ASSERT(context()->isAudioThread() && context()->isGraphOwner());
#if ENABLE(OILPAN)
if (m_renderingStateNeedUpdating) {
#else
if (m_renderingStateNeedUpdating && canUpdateState()) { if (m_renderingStateNeedUpdating && canUpdateState()) {
#endif
// Copy from m_outputs to m_renderingOutputs. // Copy from m_outputs to m_renderingOutputs.
m_renderingOutputs.resize(m_outputs.size()); m_renderingOutputs.resize(m_outputs.size());
unsigned j = 0; unsigned j = 0;
......
...@@ -57,7 +57,9 @@ public: ...@@ -57,7 +57,9 @@ public:
AudioNodeOutput* renderingOutput(unsigned i) { return m_renderingOutputs[i]; } AudioNodeOutput* renderingOutput(unsigned i) { return m_renderingOutputs[i]; }
bool isConnected() const { return numberOfRenderingConnections() > 0; } bool isConnected() const { return numberOfRenderingConnections() > 0; }
#if !ENABLE(OILPAN)
virtual bool canUpdateState() = 0; virtual bool canUpdateState() = 0;
#endif
virtual void didUpdate() = 0; virtual void didUpdate() = 0;
protected: 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