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

Unified Diff: content/browser/renderer_host/media/audio_renderer_host.cc

Issue 8818012: Remove the AudioManager singleton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Set svn eol properties for a couple of files Created 9 years 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
Index: content/browser/renderer_host/media/audio_renderer_host.cc
===================================================================
--- content/browser/renderer_host/media/audio_renderer_host.cc (revision 114012)
+++ content/browser/renderer_host/media/audio_renderer_host.cc (working copy)
@@ -270,13 +270,15 @@
// entry and construct an AudioOutputController.
entry->reader.reset(reader.release());
entry->controller =
- media::AudioOutputController::CreateLowLatency(this, audio_params,
- entry->reader.get());
+ media::AudioOutputController::CreateLowLatency(
+ resource_context_->audio_manager(), this, audio_params,
+ entry->reader.get());
} else {
// The choice of buffer capacity is based on experiment.
entry->controller =
- media::AudioOutputController::Create(this, audio_params,
- 3 * packet_size);
+ media::AudioOutputController::Create(
+ resource_context_->audio_manager(), this, audio_params,
+ 3 * packet_size);
}
if (!entry->controller) {
@@ -399,6 +401,8 @@
}
void AudioRendererHost::CloseAndDeleteStream(AudioEntry* entry) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+
if (!entry->pending_close) {
entry->controller->Close(
base::Bind(&AudioRendererHost::OnStreamClosed, this, entry));
@@ -407,7 +411,8 @@
}
void AudioRendererHost::OnStreamClosed(AudioEntry* entry) {
- // Delete the entry after we've closed the stream.
+ // Delete the entry on the IO thread after we've closed the stream.
+ // (We're currently on the audio thread).
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(&AudioRendererHost::DeleteEntry, this, entry));

Powered by Google App Engine
This is Rietveld 408576698