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

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

Issue 886173004: Fix AudioNode.disconnect() to support selective disconnection. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Conflict solved. Created 5 years, 10 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/AudioNodeOutput.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/AudioNodeOutput.cpp
diff --git a/Source/modules/webaudio/AudioNodeOutput.cpp b/Source/modules/webaudio/AudioNodeOutput.cpp
index 1fe40b2379f3c87c713c5dcc6a4ab39ebf9736e2..754a442542271eceecd70def60ec89be27b0bafc 100644
--- a/Source/modules/webaudio/AudioNodeOutput.cpp
+++ b/Source/modules/webaudio/AudioNodeOutput.cpp
@@ -190,6 +190,18 @@ void AudioNodeOutput::disconnectAllInputs()
m_inputs.begin()->key->disconnect(*this);
}
+void AudioNodeOutput::disconnectInput(AudioNodeInput& input)
+{
+ ASSERT(context()->isGraphOwner() && isConnectedToInput(input));
+ input.disconnect(*this);
+}
+
+void AudioNodeOutput::disconnectAudioParam(AudioParam& param)
+{
+ ASSERT(context()->isGraphOwner() && isConnectedToAudioParam(param));
+ param.disconnect(*this);
+}
+
void AudioNodeOutput::addParam(AudioParam& param)
{
ASSERT(context()->isGraphOwner());
@@ -217,6 +229,18 @@ void AudioNodeOutput::disconnectAll()
disconnectAllParams();
}
+bool AudioNodeOutput::isConnectedToInput(AudioNodeInput& input)
+{
+ ASSERT(context()->isGraphOwner());
+ return m_inputs.contains(&input);
+}
+
+bool AudioNodeOutput::isConnectedToAudioParam(AudioParam& param)
+{
+ ASSERT(context()->isGraphOwner());
+ return m_params.contains(&param);
+}
+
void AudioNodeOutput::disable()
{
ASSERT(context()->isGraphOwner());
« no previous file with comments | « Source/modules/webaudio/AudioNodeOutput.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698