Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MOJO_SERVICES_HTML_VIEWER_WEBMEDIAPLAYER_FACTORY_H_ | |
| 6 #define MOJO_SERVICES_HTML_VIEWER_WEBMEDIAPLAYER_FACTORY_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "base/memory/ref_counted.h" | |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "media/audio/fake_audio_log_factory.h" | |
| 12 | |
| 13 namespace base { | |
| 14 class SingleThreadTaskRunner; | |
| 15 class Thread; | |
| 16 } | |
| 17 | |
| 18 namespace blink { | |
| 19 class WebMediaPlayer; | |
| 20 class WebLocalFrame; | |
| 21 class WebURL; | |
| 22 class WebMediaPlayerClient; | |
| 23 } | |
| 24 | |
| 25 namespace media { | |
| 26 class AudioHardwareConfig; | |
| 27 class AudioManager; | |
| 28 class AudioRendererSink; | |
| 29 } | |
| 30 | |
| 31 namespace mojo { | |
| 32 | |
| 33 // Helper class used to create blink::WebMediaPlayer objects. | |
| 34 // This class stores the "global state" shared across all WebMediaPlayer | |
| 35 // instances. | |
| 36 class WebMediaPlayerFactory { | |
|
scherkus (not reviewing)
2014/09/12 00:17:53
instead of plumbing a WMPF* around ... maybe this
acolwell GONE FROM CHROMIUM
2014/09/12 16:46:02
I'm not sure what the runtime environment for the
| |
| 37 public: | |
| 38 WebMediaPlayerFactory(); | |
| 39 ~WebMediaPlayerFactory(); | |
| 40 | |
| 41 blink::WebMediaPlayer* CreateMediaPlayer( | |
| 42 blink::WebLocalFrame* frame, | |
| 43 const blink::WebURL& url, | |
| 44 blink::WebMediaPlayerClient* client); | |
| 45 | |
| 46 private: | |
| 47 const media::AudioHardwareConfig& GetAudioHardwareConfig(); | |
| 48 scoped_refptr<media::AudioRendererSink> CreateAudioRendererSink(); | |
| 49 scoped_refptr<base::SingleThreadTaskRunner> GetMediaThreadTaskRunner(); | |
| 50 | |
| 51 scoped_ptr<base::Thread> media_thread_; | |
|
scherkus (not reviewing)
2014/09/12 00:17:53
nit: this can be not a pointer and instead you can
acolwell GONE FROM CHROMIUM
2014/09/12 16:46:02
Done.
| |
| 52 media::FakeAudioLogFactory fake_audio_log_factory_; | |
| 53 scoped_ptr<media::AudioManager> audio_manager_; | |
| 54 scoped_ptr<media::AudioHardwareConfig> audio_hardware_config_; | |
|
scherkus (not reviewing)
2014/09/12 00:17:53
nit: I think all of these can be de-pointer-ized a
acolwell GONE FROM CHROMIUM
2014/09/12 16:46:02
AudioManager can't. Its constructor is protected.
| |
| 55 | |
| 56 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerFactory); | |
| 57 }; | |
| 58 | |
| 59 } // namespace mojo | |
| 60 | |
| 61 #endif // MOJO_SERVICES_HTML_VIEWER_WEBMEDIAPLAYER_FACTORY_H_ | |
| OLD | NEW |