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

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

Issue 2839063003: Implement tail processing for AudioNodes (Closed)
Patch Set: Make declaration order consistent Created 3 years, 5 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/DeferredTaskHandler.h
diff --git a/third_party/WebKit/Source/modules/webaudio/DeferredTaskHandler.h b/third_party/WebKit/Source/modules/webaudio/DeferredTaskHandler.h
index 94dfd95ce2684a8d16f1956213ceb6e2c0fbe493..23b48c585d8b8a99707764c280be077c2f2ce3f2 100644
--- a/third_party/WebKit/Source/modules/webaudio/DeferredTaskHandler.h
+++ b/third_party/WebKit/Source/modules/webaudio/DeferredTaskHandler.h
@@ -105,6 +105,14 @@ class MODULES_EXPORT DeferredTaskHandler final
void RequestToDeleteHandlersOnMainThread();
void ClearHandlersToBeDeleted();
+ // If |node| requires tail processing, add it to the list of tail
+ // nodes so the tail is processed.
+ void AddTailProcessingNode(PassRefPtr<AudioHandler> node);
+
+ // Remove |node| from the list of tail nodes (because the tail
+ // processing is complete).
+ void RemoveTailProcessingNode(PassRefPtr<AudioHandler> node);
+
//
// Thread Safety and Graph Locking:
//
@@ -171,6 +179,10 @@ class MODULES_EXPORT DeferredTaskHandler final
void HandleDirtyAudioNodeOutputs();
void DeleteHandlersOnMainThread();
+ // Check tail processing nodes and remove any node if the tail has
+ // been processed.
+ void UpdateTailProcessingNodes();
+
// For the sake of thread safety, we maintain a seperate Vector of automatic
// pull nodes for rendering in m_renderingAutomaticPullNodes. It will be
// copied from m_automaticPullNodes by updateAutomaticPullNodes() at the
@@ -199,6 +211,9 @@ class MODULES_EXPORT DeferredTaskHandler final
Vector<RefPtr<AudioHandler>> rendering_orphan_handlers_;
Vector<RefPtr<AudioHandler>> deletable_orphan_handlers_;
+ // Nodes that are processing its tail.
+ Vector<RefPtr<AudioHandler>> tail_processing_nodes_;
+
// Graph locking.
RecursiveMutex context_graph_mutex_;
volatile ThreadIdentifier audio_thread_;

Powered by Google App Engine
This is Rietveld 408576698