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

Side by Side Diff: content/renderer/media/audio_device_factory.cc

Issue 10835025: Plumb render view ID to media observer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
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 #include "content/renderer/media/audio_device_factory.h" 5 #include "content/renderer/media/audio_device_factory.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/common/child_process.h" 8 #include "content/common/child_process.h"
9 #include "content/renderer/media/audio_device.h" 9 #include "content/renderer/media/audio_device.h"
10 10
11 namespace content { 11 namespace content {
12 12
13 // static 13 // static
14 AudioDeviceFactory* AudioDeviceFactory::factory_ = NULL; 14 AudioDeviceFactory* AudioDeviceFactory::factory_ = NULL;
15 15
16 // static 16 // static
17 media::AudioRendererSink* AudioDeviceFactory::Create() { 17 media::AudioRendererSink* AudioDeviceFactory::Create(RenderView* render_view) {
18 if (factory_) { 18 if (factory_) {
19 return factory_->CreateAudioDevice(); 19 return factory_->CreateAudioDevice();
20 } 20 }
21 return new AudioDevice( 21 return new AudioDevice(
22 render_view,
22 ChildProcess::current()->io_message_loop()->message_loop_proxy()); 23 ChildProcess::current()->io_message_loop()->message_loop_proxy());
23 } 24 }
24 25
25 AudioDeviceFactory::AudioDeviceFactory() { 26 AudioDeviceFactory::AudioDeviceFactory() {
26 DCHECK(!factory_) << "Can't register two factories at once."; 27 DCHECK(!factory_) << "Can't register two factories at once.";
27 factory_ = this; 28 factory_ = this;
28 } 29 }
29 30
30 AudioDeviceFactory::~AudioDeviceFactory() { 31 AudioDeviceFactory::~AudioDeviceFactory() {
31 factory_ = NULL; 32 factory_ = NULL;
32 } 33 }
33 34
34 } // namespace content 35 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/audio_device_factory.h ('k') | content/renderer/media/audio_renderer_mixer_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698