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

Unified Diff: Source/modules/webaudio/AudioContext.cpp

Issue 386403002: WebAudio: Split AudioNode::finishDeref into two parts. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: apply review comments Created 6 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
« no previous file with comments | « Source/modules/webaudio/AudioContext.h ('k') | Source/modules/webaudio/AudioNode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/AudioContext.cpp
diff --git a/Source/modules/webaudio/AudioContext.cpp b/Source/modules/webaudio/AudioContext.cpp
index b95baa9b5029229b3c05accae3cbd6c20fcef04b..277aee63acbd284935e2a26e9bebed282876f254 100644
--- a/Source/modules/webaudio/AudioContext.cpp
+++ b/Source/modules/webaudio/AudioContext.cpp
@@ -681,6 +681,12 @@ bool AudioContext::isGraphOwner() const
return currentThread() == m_graphOwnerThread;
}
+void AudioContext::addDeferredBreakConnection(AudioNode& node)
+{
+ ASSERT(isAudioThread());
+ m_deferredBreakConnectionList.append(&node);
+}
+
void AudioContext::addDeferredFinishDeref(AudioNode* node)
{
ASSERT(isAudioThread());
@@ -715,8 +721,8 @@ void AudioContext::handlePostRenderTasks()
// from the render graph (in which case they'll render silence).
bool mustReleaseLock;
if (tryLock(mustReleaseLock)) {
- // Take care of finishing any derefs where the tryLock() failed previously.
- handleDeferredFinishDerefs();
+ // Take care of AudioNode tasks where the tryLock() failed previously.
+ handleDeferredAudioNodeTasks();
// Dynamically clean up nodes which are no longer needed.
derefFinishedSourceNodes();
@@ -736,14 +742,16 @@ void AudioContext::handlePostRenderTasks()
}
}
-void AudioContext::handleDeferredFinishDerefs()
+void AudioContext::handleDeferredAudioNodeTasks()
{
ASSERT(isAudioThread() && isGraphOwner());
- for (unsigned i = 0; i < m_deferredFinishDerefList.size(); ++i) {
- AudioNode* node = m_deferredFinishDerefList[i];
- node->finishDeref();
- }
+ for (unsigned i = 0; i < m_deferredBreakConnectionList.size(); ++i)
+ m_deferredBreakConnectionList[i]->breakConnectionWithLock();
+ m_deferredBreakConnectionList.clear();
+
+ for (unsigned i = 0; i < m_deferredFinishDerefList.size(); ++i)
+ m_deferredFinishDerefList[i]->finishDeref();
m_deferredFinishDerefList.clear();
}
« no previous file with comments | « Source/modules/webaudio/AudioContext.h ('k') | Source/modules/webaudio/AudioNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698