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

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

Issue 2638413004: Don't run removeFinishedSourceNodes with the context lock. (Closed)
Patch Set: Add removeFinishedSourceNodesOnMainThread Created 3 years, 11 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/BaseAudioContext.h
diff --git a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h
index afdf59e0a505a331933784de1e90f77c63de3f0e..1a2baa077bae1aff1bfe02298a2f025f4e258e17 100644
--- a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h
+++ b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h
@@ -249,9 +249,15 @@ class MODULES_EXPORT BaseAudioContext
// Called at the end of each render quantum.
void handlePostRenderTasks();
- // Called periodically at the end of each render quantum to release finished
- // source nodes.
- void releaseFinishedSourceNodes();
+ // Called periodically at the end of each render quantum to release
+ // finished source nodes. Updates m_finishedSourceNodes with nodes
+ // to be deleted. Returns true if any node needs deletion. Must be
+ // run from the audio thread.
+ bool releaseFinishedSourceNodes();
+
+ // The finished source nodes found by |releaseFinishedSourceNodes|
+ // will be removed on the main thread, which is done here.
+ void removeFinishedSourceNodes(bool needsRemoval);
// Keeps track of the number of connections made.
void incrementConnectionCount() {
@@ -379,7 +385,10 @@ class MODULES_EXPORT BaseAudioContext
// haven't finished playing. Make sure to release them here.
void releaseActiveSourceNodes();
- void removeFinishedSourceNodes();
+ // Actually remove the nodes noted for deletion by
+ // releaseFinishedSourceNodes. Must be run from the main thread,
+ // and must not be run with the context lock.
+ void removeFinishedSourceNodesOnMainThread();
// Listener for the PannerNodes
Member<AudioListener> m_listener;

Powered by Google App Engine
This is Rietveld 408576698