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

Side by Side Diff: third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp

Issue 2768683004: Revert of Lock out GCs while iterating over MediaStreamSource audio consumers. (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 unified diff | Download patch
« no previous file with comments | « no previous file | 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) 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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698