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

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

Issue 188243002: Fix AudioEntry destruction order. Add debugging CHECKs for racy shutdown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Typos. Created 6 years, 10 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 | « no previous file | media/audio/audio_output_controller.h » ('j') | media/audio/audio_output_controller.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/audio_renderer_host.cc
diff --git a/content/browser/renderer_host/media/audio_renderer_host.cc b/content/browser/renderer_host/media/audio_renderer_host.cc
index 01eef909f1257186bc4036ec2dcce7a0ddc12466..c09521332b1486839f0b844a64c4a27becb6e777 100644
--- a/content/browser/renderer_host/media/audio_renderer_host.cc
+++ b/content/browser/renderer_host/media/audio_renderer_host.cc
@@ -74,18 +74,20 @@ class AudioRendererHost::AudioEntry
// The routing ID of the source render view.
const int render_view_id_;
- // The AudioOutputController that manages the audio stream.
- const scoped_refptr<media::AudioOutputController> controller_;
-
- // Shared memory for transmission of the audio data.
+ // Shared memory for transmission of the audio data. Used by |reader_|.
const scoped_ptr<base::SharedMemory> shared_memory_;
- // The synchronous reader to be used by the controller.
+ // The synchronous reader to be used by |controller_|.
const scoped_ptr<media::AudioOutputController::SyncReader> reader_;
+
+ // The AudioOutputController that manages the audio stream.
+ const scoped_refptr<media::AudioOutputController> controller_;
};
AudioRendererHost::AudioEntry::AudioEntry(
- AudioRendererHost* host, int stream_id, int render_view_id,
+ AudioRendererHost* host,
+ int stream_id,
+ int render_view_id,
const media::AudioParameters& params,
const std::string& output_device_id,
scoped_ptr<base::SharedMemory> shared_memory,
@@ -93,10 +95,13 @@ AudioRendererHost::AudioEntry::AudioEntry(
: host_(host),
stream_id_(stream_id),
render_view_id_(render_view_id),
- controller_(media::AudioOutputController::Create(
- host->audio_manager_, this, params, output_device_id, reader.get())),
shared_memory_(shared_memory.Pass()),
- reader_(reader.Pass()) {
+ reader_(reader.Pass()),
+ controller_(media::AudioOutputController::Create(host->audio_manager_,
+ this,
+ params,
+ output_device_id,
+ reader_.get())) {
DCHECK(controller_.get());
}
« no previous file with comments | « no previous file | media/audio/audio_output_controller.h » ('j') | media/audio/audio_output_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698