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

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

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
« no previous file with comments | « content/renderer/media/audio_device.cc ('k') | content/renderer/media/audio_device_factory.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 #ifndef CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_
6 #define CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_ 6 #define CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "content/common/content_export.h" 9 #include "content/common/content_export.h"
10 10
11 namespace content {
12 class RenderView;
13 }
14
11 namespace media { 15 namespace media {
12 class AudioRendererSink; 16 class AudioRendererSink;
13 } 17 }
14 18
15 namespace content { 19 namespace content {
16 20
17 // A factory for creating AudioRendererSinks. There is a global factory 21 // A factory for creating AudioRendererSinks. There is a global factory
18 // function that can be installed for the purposes of testing to provide 22 // function that can be installed for the purposes of testing to provide
19 // a specialized AudioRendererSink class. 23 // a specialized AudioRendererSink class.
20 // This class uses the same pattern as content::RenderViewHostFactory. 24 // This class uses the same pattern as content::RenderViewHostFactory.
21 class CONTENT_EXPORT AudioDeviceFactory { 25 class CONTENT_EXPORT AudioDeviceFactory {
22 public: 26 public:
23 // Creates an AudioRendererSink using the currently registered factory, 27 // Creates an AudioRendererSink using the currently registered factory,
24 // or the default one if no factory is registered. Ownership of the returned 28 // or the default one if no factory is registered. Ownership of the returned
25 // pointer will be passed to the caller. 29 // pointer will be passed to the caller.
26 static media::AudioRendererSink* Create(); 30 static media::AudioRendererSink* Create(RenderView* render_view);
27 31
28 protected: 32 protected:
29 AudioDeviceFactory(); 33 AudioDeviceFactory();
30 virtual ~AudioDeviceFactory(); 34 virtual ~AudioDeviceFactory();
31 35
32 // You can derive from this class and specify an implementation for this 36 // You can derive from this class and specify an implementation for this
33 // function to create a different kind of AudioRendererSink for testing. 37 // function to create a different kind of AudioRendererSink for testing.
34 virtual media::AudioRendererSink* CreateAudioDevice() = 0; 38 virtual media::AudioRendererSink* CreateAudioDevice() = 0;
35 39
36 private: 40 private:
37 // The current globally registered factory. This is NULL when we should 41 // The current globally registered factory. This is NULL when we should
38 // create the default AudioRendererSinks. 42 // create the default AudioRendererSinks.
39 static AudioDeviceFactory* factory_; 43 static AudioDeviceFactory* factory_;
40 44
41 DISALLOW_COPY_AND_ASSIGN(AudioDeviceFactory); 45 DISALLOW_COPY_AND_ASSIGN(AudioDeviceFactory);
42 }; 46 };
43 47
44 } // namespace content 48 } // namespace content
45 49
46 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_ 50 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_
OLDNEW
« no previous file with comments | « content/renderer/media/audio_device.cc ('k') | content/renderer/media/audio_device_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698