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

Unified Diff: third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp

Issue 2757883002: Revert "Pull AudioDestinationConsumer off the Blink GC heap." (Closed)
Patch Set: Created 3 years, 9 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 | « third_party/WebKit/Source/platform/mediastream/MediaStreamSource.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp
diff --git a/third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp b/third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp
index ca12e1c9fb79b62562e07491d45e500f71a78aa7..fe6021b2415d2368840b84e4e602362c831b0682 100644
--- a/third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp
+++ b/third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp
@@ -85,7 +85,8 @@ bool MediaStreamSource::removeAudioConsumer(
AudioDestinationConsumer* consumer) {
ASSERT(m_requiresConsumer);
MutexLocker locker(m_audioConsumersLock);
- auto it = m_audioConsumers.find(consumer);
+ HeapHashSet<Member<AudioDestinationConsumer>>::iterator it =
+ m_audioConsumers.find(consumer);
if (it == m_audioConsumers.end())
return false;
m_audioConsumers.erase(it);
@@ -100,8 +101,10 @@ void MediaStreamSource::setAudioFormat(size_t numberOfChannels,
float sampleRate) {
ASSERT(m_requiresConsumer);
MutexLocker locker(m_audioConsumersLock);
- for (AudioDestinationConsumer* consumer : m_audioConsumers)
- consumer->setFormat(numberOfChannels, sampleRate);
+ for (HeapHashSet<Member<AudioDestinationConsumer>>::iterator it =
+ m_audioConsumers.begin();
+ it != m_audioConsumers.end(); ++it)
+ (*it)->setFormat(numberOfChannels, sampleRate);
}
void MediaStreamSource::consumeAudio(AudioBus* bus, size_t numberOfFrames) {
@@ -110,12 +113,15 @@ void MediaStreamSource::consumeAudio(AudioBus* bus, size_t numberOfFrames) {
// Prevent GCs from going ahead while this iteration runs, attempting to
// pinpoint crbug.com/682945 failures.
ThreadState::MainThreadGCForbiddenScope scope;
- for (AudioDestinationConsumer* consumer : m_audioConsumers)
- consumer->consumeAudio(bus, numberOfFrames);
+ for (HeapHashSet<Member<AudioDestinationConsumer>>::iterator it =
+ m_audioConsumers.begin();
+ it != m_audioConsumers.end(); ++it)
+ (*it)->consumeAudio(bus, numberOfFrames);
}
DEFINE_TRACE(MediaStreamSource) {
visitor->trace(m_observers);
+ visitor->trace(m_audioConsumers);
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/mediastream/MediaStreamSource.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698