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

Side by Side Diff: media/audio/audio_output_device.h

Issue 10958004: Prevent AudioDeviceThread from starting if clients have called Stop() (round 2). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | media/audio/audio_output_device.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Audio rendering unit utilizing audio output stream provided by browser 5 // Audio rendering unit utilizing audio output stream provided by browser
6 // process through IPC. 6 // process through IPC.
7 // 7 //
8 // Relationship of classes. 8 // Relationship of classes.
9 // 9 //
10 // AudioOutputController AudioOutputDevice 10 // AudioOutputController AudioOutputDevice
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 153
154 // Our audio thread callback class. See source file for details. 154 // Our audio thread callback class. See source file for details.
155 class AudioThreadCallback; 155 class AudioThreadCallback;
156 156
157 // In order to avoid a race between OnStreamCreated and Stop(), we use this 157 // In order to avoid a race between OnStreamCreated and Stop(), we use this
158 // guard to control stopping and starting the audio thread. 158 // guard to control stopping and starting the audio thread.
159 base::Lock audio_thread_lock_; 159 base::Lock audio_thread_lock_;
160 AudioDeviceThread audio_thread_; 160 AudioDeviceThread audio_thread_;
161 scoped_ptr<AudioOutputDevice::AudioThreadCallback> audio_callback_; 161 scoped_ptr<AudioOutputDevice::AudioThreadCallback> audio_callback_;
162 162
163 // Temporary hack to ignore OnStreamCreated() due to the user calling Stop()
164 // so we don't start the audio thread pointing to a potentially freed
165 // |callback_|.
166 //
167 // TODO(scherkus): Replace this by changing AudioRendererSink to either accept
168 // the callback via Start(). See http://crbug.com/151051 for details.
169 bool stopping_hack_;
170
163 DISALLOW_COPY_AND_ASSIGN(AudioOutputDevice); 171 DISALLOW_COPY_AND_ASSIGN(AudioOutputDevice);
164 }; 172 };
165 173
166 } // namespace media 174 } // namespace media
167 175
168 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_DEVICE_H_ 176 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_DEVICE_H_
OLDNEW
« no previous file with comments | « no previous file | media/audio/audio_output_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698