Index: Source/modules/webaudio/AudioNode.cpp |
diff --git a/Source/modules/webaudio/AudioNode.cpp b/Source/modules/webaudio/AudioNode.cpp |
index e2c93c0683e820652cadc5497b0789b05f0d49a1..66c9566c495b3664093e767604295ef2426be46f 100644 |
--- a/Source/modules/webaudio/AudioNode.cpp |
+++ b/Source/modules/webaudio/AudioNode.cpp |
@@ -45,7 +45,8 @@ |
namespace WebCore { |
AudioNode::AudioNode(AudioContext* context, float sampleRate) |
- : m_isInitialized(false) |
+ : ActiveDOMObject(context->scriptExecutionContext()) |
+ , m_isInitialized(false) |
, m_nodeType(NodeTypeUnknown) |
, m_context(context) |
, m_sampleRate(sampleRate) |
@@ -65,6 +66,11 @@ AudioNode::AudioNode(AudioContext* context, float sampleRate) |
atexit(AudioNode::printNodeCounts); |
} |
#endif |
+ |
+ // since we're just using the ActiveDOMObject instance for GC, |
+ // we can suspendIfNeeded here. suspendIfNeeded needs to be called |
+ // at some point on every ActiveDOMObject. |
+ suspendIfNeeded(); |
} |
AudioNode::~AudioNode() |
@@ -282,10 +288,26 @@ void AudioNode::updateChannelsForInputs() |
input(i)->changedOutputs(); |
} |
+const AtomicString& AudioNode::interfaceName() const |
+{ |
+ return eventNames().interfaceForAudioNode; |
+} |
+ |
+ScriptExecutionContext* AudioNode::scriptExecutionContext() const |
+{ |
+ return const_cast<AudioNode*>(this)->context()->scriptExecutionContext(); |
+} |
+ |
+ |
+bool AudioNode::hasPendingActivity() const |
+{ |
+ return !m_isDisabled && (m_connectionRefCount > 0); |
+} |
+ |
void AudioNode::processIfNecessary(size_t framesToProcess) |
{ |
ASSERT(context()->isAudioThread()); |
- |
+ |
if (!isInitialized()) |
return; |