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

Side by Side Diff: Source/modules/webaudio/AudioNodeOutput.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/modules/webaudio/AudioNodeOutput.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 153
154 void AudioNodeOutput::addInput(AudioNodeInput* input) 154 void AudioNodeOutput::addInput(AudioNodeInput* input)
155 { 155 {
156 ASSERT(context()->isGraphOwner()); 156 ASSERT(context()->isGraphOwner());
157 157
158 ASSERT(input); 158 ASSERT(input);
159 if (!input) 159 if (!input)
160 return; 160 return;
161 161
162 m_inputs.add(input); 162 m_inputs.add(input);
163 m_inputNodes.add(input->node());
164 input->node()->makeConnection();
165 } 163 }
166 164
167 void AudioNodeOutput::removeInput(AudioNodeInput* input) 165 void AudioNodeOutput::removeInput(AudioNodeInput* input)
168 { 166 {
169 ASSERT(context()->isGraphOwner()); 167 ASSERT(context()->isGraphOwner());
170 168
171 ASSERT(input); 169 ASSERT(input);
172 if (!input) 170 if (!input)
173 return; 171 return;
174 172
175 m_inputs.remove(input); 173 m_inputs.remove(input);
176 input->node()->breakConnection();
177 m_inputNodes.remove(input->node());
178 } 174 }
179 175
180 void AudioNodeOutput::disconnectAllInputs() 176 void AudioNodeOutput::disconnectAllInputs()
181 { 177 {
182 ASSERT(context()->isGraphOwner()); 178 ASSERT(context()->isGraphOwner());
183 179
184 // AudioNodeInput::disconnect() changes m_inputs by calling removeInput(). 180 // AudioNodeInput::disconnect() changes m_inputs by calling removeInput().
185 while (!m_inputs.isEmpty()) { 181 while (!m_inputs.isEmpty()) {
186 AudioNodeInput* input = *m_inputs.begin(); 182 AudioNodeInput* input = *m_inputs.begin();
187 input->disconnect(this); 183 input->disconnect(this);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 AudioNodeInput* input = *i; 245 AudioNodeInput* input = *i;
250 input->enable(this); 246 input->enable(this);
251 } 247 }
252 m_isEnabled = true; 248 m_isEnabled = true;
253 } 249 }
254 } 250 }
255 251
256 } // namespace WebCore 252 } // namespace WebCore
257 253
258 #endif // ENABLE(WEB_AUDIO) 254 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« 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