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

Unified Diff: third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.h

Issue 2283053002: Fix BaseAudioContext::hasPendingActivity() to make it GCed correctly (Closed)
Patch Set: Created 4 years, 4 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
Index: third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.h
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.h b/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.h
index a2c419a469b5e4eb25eeb45044ca653c52585bbc..40758cb907402dce56116c4d1411719d36089846 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.h
+++ b/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.h
@@ -56,6 +56,8 @@ public:
virtual void startRendering() = 0;
virtual void stopRendering() = 0;
+ unsigned numberOfConnections() const;
+
protected:
// LocalAudioInputProvider allows us to expose an AudioSourceProvider for local/live audio input.
// If there is local/live audio input, we call set() with the audio input data every render quantum.
@@ -88,6 +90,12 @@ protected:
// Counts the number of sample-frames processed by the destination.
size_t m_currentSampleFrame;
+ // Represents the number of incoming connections toward this destination
+ // node. It is updated every render quantum atomically, and it proxies
+ // the connection count for the rendering operation used in
+ // AudioSummingJuntion.
+ unsigned m_numberOfConnections;
+
LocalAudioInputProvider m_localAudioInputProvider;
};
@@ -98,6 +106,8 @@ public:
unsigned long maxChannelCount() const;
+ bool hasConnection() const;
+
protected:
AudioDestinationNode(BaseAudioContext&);
};

Powered by Google App Engine
This is Rietveld 408576698