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

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

Issue 385953003: Revert of WebAudio: Remove AudioNode::RefType. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/AudioNode.cpp ('k') | Source/modules/webaudio/AudioNodeOutput.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/AudioNodeInput.cpp
diff --git a/Source/modules/webaudio/AudioNodeInput.cpp b/Source/modules/webaudio/AudioNodeInput.cpp
index bb157c7c74c70cc1a0022d80bd5c5def17776896..7c79549e62153cb52c4a8ce6913a42609675db6c 100644
--- a/Source/modules/webaudio/AudioNodeInput.cpp
+++ b/Source/modules/webaudio/AudioNodeInput.cpp
@@ -62,6 +62,9 @@
output->addInput(this);
m_outputs.add(output);
changedOutputs();
+
+ // Sombody has just connected to us, so count it as a reference.
+ node()->ref(AudioNode::RefTypeConnection);
}
void AudioNodeInput::disconnect(AudioNodeOutput* output)
@@ -77,8 +80,7 @@
m_outputs.remove(output);
changedOutputs();
output->removeInput(this);
- // Note: it's important to return immediately after removeInput() calls
- // since the node may be deleted.
+ node()->deref(AudioNode::RefTypeConnection); // Note: it's important to return immediately after all deref() calls since the node may be deleted.
return;
}
@@ -86,8 +88,7 @@
if (m_disabledOutputs.contains(output)) {
m_disabledOutputs.remove(output);
output->removeInput(this);
- // Note: it's important to return immediately after all removeInput() calls
- // since the node may be deleted.
+ node()->deref(AudioNode::RefTypeConnection); // Note: it's important to return immediately after all deref() calls since the node may be deleted.
return;
}
« no previous file with comments | « Source/modules/webaudio/AudioNode.cpp ('k') | Source/modules/webaudio/AudioNodeOutput.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698