| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 m_private->addAudioConsumer(ConsumerWrapper::create(consumer)); | 214 m_private->addAudioConsumer(ConsumerWrapper::create(consumer)); |
| 215 } | 215 } |
| 216 | 216 |
| 217 bool WebMediaStreamSource::removeAudioConsumer(WebAudioDestinationConsumer* cons
umer) | 217 bool WebMediaStreamSource::removeAudioConsumer(WebAudioDestinationConsumer* cons
umer) |
| 218 { | 218 { |
| 219 ASSERT(isMainThread()); | 219 ASSERT(isMainThread()); |
| 220 ASSERT(!m_private.isNull() && consumer); | 220 ASSERT(!m_private.isNull() && consumer); |
| 221 | 221 |
| 222 const Vector<RefPtr<AudioDestinationConsumer> >& consumers = m_private->audi
oConsumers(); | 222 const Vector<RefPtr<AudioDestinationConsumer> >& consumers = m_private->audi
oConsumers(); |
| 223 for (Vector<RefPtr<AudioDestinationConsumer> >::const_iterator it = consumer
s.begin(); it != consumers.end(); ++it) { | 223 for (Vector<RefPtr<AudioDestinationConsumer> >::const_iterator it = consumer
s.begin(); it != consumers.end(); ++it) { |
| 224 ConsumerWrapper* wrapper = static_cast<ConsumerWrapper*>((*it).get()); | 224 ConsumerWrapper* wrapper = static_cast<ConsumerWrapper*>(it->get()); |
| 225 if (wrapper->consumer() == consumer) { | 225 if (wrapper->consumer() == consumer) { |
| 226 m_private->removeAudioConsumer(wrapper); | 226 m_private->removeAudioConsumer(wrapper); |
| 227 return true; | 227 return true; |
| 228 } | 228 } |
| 229 } | 229 } |
| 230 return false; | 230 return false; |
| 231 } | 231 } |
| 232 | 232 |
| 233 } // namespace blink | 233 } // namespace blink |
| OLD | NEW |