| OLD | NEW |
| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 161 |
| 162 void AudioNodeOutput::addInput(AudioNodeInput& input) { | 162 void AudioNodeOutput::addInput(AudioNodeInput& input) { |
| 163 ASSERT(deferredTaskHandler().isGraphOwner()); | 163 ASSERT(deferredTaskHandler().isGraphOwner()); |
| 164 m_inputs.insert(&input); | 164 m_inputs.insert(&input); |
| 165 input.handler().makeConnection(); | 165 input.handler().makeConnection(); |
| 166 } | 166 } |
| 167 | 167 |
| 168 void AudioNodeOutput::removeInput(AudioNodeInput& input) { | 168 void AudioNodeOutput::removeInput(AudioNodeInput& input) { |
| 169 ASSERT(deferredTaskHandler().isGraphOwner()); | 169 ASSERT(deferredTaskHandler().isGraphOwner()); |
| 170 input.handler().breakConnection(); | 170 input.handler().breakConnection(); |
| 171 m_inputs.remove(&input); | 171 m_inputs.erase(&input); |
| 172 } | 172 } |
| 173 | 173 |
| 174 void AudioNodeOutput::disconnectAllInputs() { | 174 void AudioNodeOutput::disconnectAllInputs() { |
| 175 ASSERT(deferredTaskHandler().isGraphOwner()); | 175 ASSERT(deferredTaskHandler().isGraphOwner()); |
| 176 | 176 |
| 177 // AudioNodeInput::disconnect() changes m_inputs by calling removeInput(). | 177 // AudioNodeInput::disconnect() changes m_inputs by calling removeInput(). |
| 178 while (!m_inputs.isEmpty()) | 178 while (!m_inputs.isEmpty()) |
| 179 (*m_inputs.begin())->disconnect(*this); | 179 (*m_inputs.begin())->disconnect(*this); |
| 180 } | 180 } |
| 181 | 181 |
| 182 void AudioNodeOutput::disconnectInput(AudioNodeInput& input) { | 182 void AudioNodeOutput::disconnectInput(AudioNodeInput& input) { |
| 183 ASSERT(deferredTaskHandler().isGraphOwner()); | 183 ASSERT(deferredTaskHandler().isGraphOwner()); |
| 184 DCHECK(isConnectedToInput(input)); | 184 DCHECK(isConnectedToInput(input)); |
| 185 input.disconnect(*this); | 185 input.disconnect(*this); |
| 186 } | 186 } |
| 187 | 187 |
| 188 void AudioNodeOutput::disconnectAudioParam(AudioParamHandler& param) { | 188 void AudioNodeOutput::disconnectAudioParam(AudioParamHandler& param) { |
| 189 ASSERT(deferredTaskHandler().isGraphOwner()); | 189 ASSERT(deferredTaskHandler().isGraphOwner()); |
| 190 DCHECK(isConnectedToAudioParam(param)); | 190 DCHECK(isConnectedToAudioParam(param)); |
| 191 param.disconnect(*this); | 191 param.disconnect(*this); |
| 192 } | 192 } |
| 193 | 193 |
| 194 void AudioNodeOutput::addParam(AudioParamHandler& param) { | 194 void AudioNodeOutput::addParam(AudioParamHandler& param) { |
| 195 ASSERT(deferredTaskHandler().isGraphOwner()); | 195 ASSERT(deferredTaskHandler().isGraphOwner()); |
| 196 m_params.insert(¶m); | 196 m_params.insert(¶m); |
| 197 } | 197 } |
| 198 | 198 |
| 199 void AudioNodeOutput::removeParam(AudioParamHandler& param) { | 199 void AudioNodeOutput::removeParam(AudioParamHandler& param) { |
| 200 ASSERT(deferredTaskHandler().isGraphOwner()); | 200 ASSERT(deferredTaskHandler().isGraphOwner()); |
| 201 m_params.remove(¶m); | 201 m_params.erase(¶m); |
| 202 } | 202 } |
| 203 | 203 |
| 204 void AudioNodeOutput::disconnectAllParams() { | 204 void AudioNodeOutput::disconnectAllParams() { |
| 205 ASSERT(deferredTaskHandler().isGraphOwner()); | 205 ASSERT(deferredTaskHandler().isGraphOwner()); |
| 206 | 206 |
| 207 // AudioParam::disconnect() changes m_params by calling removeParam(). | 207 // AudioParam::disconnect() changes m_params by calling removeParam(). |
| 208 while (!m_params.isEmpty()) | 208 while (!m_params.isEmpty()) |
| 209 (*m_params.begin())->disconnect(*this); | 209 (*m_params.begin())->disconnect(*this); |
| 210 } | 210 } |
| 211 | 211 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 238 ASSERT(deferredTaskHandler().isGraphOwner()); | 238 ASSERT(deferredTaskHandler().isGraphOwner()); |
| 239 | 239 |
| 240 if (!m_isEnabled) { | 240 if (!m_isEnabled) { |
| 241 m_isEnabled = true; | 241 m_isEnabled = true; |
| 242 for (AudioNodeInput* i : m_inputs) | 242 for (AudioNodeInput* i : m_inputs) |
| 243 i->enable(*this); | 243 i->enable(*this); |
| 244 } | 244 } |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // namespace blink | 247 } // namespace blink |
| OLD | NEW |