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

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

Issue 1958583002: Update AbstractAudioContext::m_activeSourceNodes on the main thread only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « no previous file | third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h
diff --git a/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h b/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h
index 36ec45af392713909422182a16bb4d6a02d272cd..a0c44233399c801f7aca3c235faedc4a1f77c1a6 100644
--- a/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h
+++ b/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h
@@ -144,7 +144,7 @@ public:
// Handles the promise and callbacks when |decodeAudioData| is finished decoding.
void handleDecodeAudioData(AudioBuffer*, ScriptPromiseResolver*, AudioBufferCallback* successCallback, AudioBufferCallback* errorCallback);
- AudioListener* listener() { return m_listener.get(); }
+ AudioListener* listener() { return m_listener; }
virtual bool hasRealtimeConstraint() = 0;
@@ -299,6 +299,8 @@ private:
// haven't finished playing. Make sure to release them here.
void releaseActiveSourceNodes();
+ void removeFinishedSourceNodes();
+
Member<AudioListener> m_listener;
// Only accessed in the audio thread.
@@ -314,6 +316,12 @@ private:
// this.
HeapVector<Member<AudioNode>> m_activeSourceNodes;
+ // The main thread controls m_activeSourceNodes, all updates and additions
+ // are performed by it. When the audio thread marks a source node as finished,
+ // the nodes are added to |m_finishedSourceNodes| and scheduled for removal
+ // from |m_activeSourceNodes| by the main thread.
+ Vector<UntracedMember<AudioNode>> m_finishedSourceNodes;
+
// FIXME(dominicc): Move these to AudioContext because only
// it creates these Promises.
// Handle Promises for resume() and suspend()
@@ -331,7 +339,6 @@ private:
unsigned m_connectionCount;
// Graph locking.
- bool m_didInitializeContextGraphMutex;
RefPtr<DeferredTaskHandler> m_deferredTaskHandler;
// The state of the AbstractAudioContext.
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698