| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 float sampleRate) { | 100 float sampleRate) { |
| 101 ASSERT(m_requiresConsumer); | 101 ASSERT(m_requiresConsumer); |
| 102 MutexLocker locker(m_audioConsumersLock); | 102 MutexLocker locker(m_audioConsumersLock); |
| 103 for (AudioDestinationConsumer* consumer : m_audioConsumers) | 103 for (AudioDestinationConsumer* consumer : m_audioConsumers) |
| 104 consumer->setFormat(numberOfChannels, sampleRate); | 104 consumer->setFormat(numberOfChannels, sampleRate); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void MediaStreamSource::consumeAudio(AudioBus* bus, size_t numberOfFrames) { | 107 void MediaStreamSource::consumeAudio(AudioBus* bus, size_t numberOfFrames) { |
| 108 ASSERT(m_requiresConsumer); | 108 ASSERT(m_requiresConsumer); |
| 109 MutexLocker locker(m_audioConsumersLock); | 109 MutexLocker locker(m_audioConsumersLock); |
| 110 // Prevent GCs from going ahead while this iteration runs, attempting to | |
| 111 // pinpoint crbug.com/682945 failures. | |
| 112 ThreadState::MainThreadGCForbiddenScope scope; | |
| 113 for (AudioDestinationConsumer* consumer : m_audioConsumers) | 110 for (AudioDestinationConsumer* consumer : m_audioConsumers) |
| 114 consumer->consumeAudio(bus, numberOfFrames); | 111 consumer->consumeAudio(bus, numberOfFrames); |
| 115 } | 112 } |
| 116 | 113 |
| 117 DEFINE_TRACE(MediaStreamSource) { | 114 DEFINE_TRACE(MediaStreamSource) { |
| 118 visitor->trace(m_observers); | 115 visitor->trace(m_observers); |
| 119 } | 116 } |
| 120 | 117 |
| 121 } // namespace blink | 118 } // namespace blink |
| OLD | NEW |