Chromium Code Reviews| Index: mojo/services/html_viewer/webmediaplayer_factory.h |
| diff --git a/mojo/services/html_viewer/webmediaplayer_factory.h b/mojo/services/html_viewer/webmediaplayer_factory.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..560885d8d1ec55cdd57c3a8d8c0d8e195aa6edcc |
| --- /dev/null |
| +++ b/mojo/services/html_viewer/webmediaplayer_factory.h |
| @@ -0,0 +1,61 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef MOJO_SERVICES_HTML_VIEWER_WEBMEDIAPLAYER_FACTORY_H_ |
| +#define MOJO_SERVICES_HTML_VIEWER_WEBMEDIAPLAYER_FACTORY_H_ |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "media/audio/fake_audio_log_factory.h" |
| + |
| +namespace base { |
| +class SingleThreadTaskRunner; |
| +class Thread; |
| +} |
| + |
| +namespace blink { |
| +class WebMediaPlayer; |
| +class WebLocalFrame; |
| +class WebURL; |
| +class WebMediaPlayerClient; |
| +} |
| + |
| +namespace media { |
| +class AudioHardwareConfig; |
| +class AudioManager; |
| +class AudioRendererSink; |
| +} |
| + |
| +namespace mojo { |
| + |
| +// Helper class used to create blink::WebMediaPlayer objects. |
| +// This class stores the "global state" shared across all WebMediaPlayer |
| +// instances. |
| +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
|
| + public: |
| + WebMediaPlayerFactory(); |
| + ~WebMediaPlayerFactory(); |
| + |
| + blink::WebMediaPlayer* CreateMediaPlayer( |
| + blink::WebLocalFrame* frame, |
| + const blink::WebURL& url, |
| + blink::WebMediaPlayerClient* client); |
| + |
| + private: |
| + const media::AudioHardwareConfig& GetAudioHardwareConfig(); |
| + scoped_refptr<media::AudioRendererSink> CreateAudioRendererSink(); |
| + scoped_refptr<base::SingleThreadTaskRunner> GetMediaThreadTaskRunner(); |
| + |
| + 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.
|
| + media::FakeAudioLogFactory fake_audio_log_factory_; |
| + scoped_ptr<media::AudioManager> audio_manager_; |
| + 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.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerFactory); |
| +}; |
| + |
| +} // namespace mojo |
| + |
| +#endif // MOJO_SERVICES_HTML_VIEWER_WEBMEDIAPLAYER_FACTORY_H_ |