Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2377)

Unified Diff: Source/modules/webaudio/AudioNode.cpp

Issue 270103005: Tried to move AudioSummingJuction to oilpan (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/webaudio/AudioNode.h ('k') | Source/modules/webaudio/AudioNode.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « Source/modules/webaudio/AudioNode.h ('k') | Source/modules/webaudio/AudioNode.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698