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

Unified Diff: mojo/services/html_viewer/webmediaplayer_factory.h

Issue 567803002: Hook WebMediaPlayerImpl up to Mojo's HTMLDocumentView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address CR comment Created 6 years, 3 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 | « mojo/services/html_viewer/html_viewer.cc ('k') | mojo/services/html_viewer/webmediaplayer_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..db853703862ecfbe4b48e93f8dbcd6fe6302d866
--- /dev/null
+++ b/mojo/services/html_viewer/webmediaplayer_factory.h
@@ -0,0 +1,62 @@
+// 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 "base/threading/thread.h"
+#include "media/audio/fake_audio_log_factory.h"
+#include "media/base/audio_hardware_config.h"
+
+namespace base {
+class SingleThreadTaskRunner;
+}
+
+namespace blink {
+class WebMediaPlayer;
+class WebLocalFrame;
+class WebURL;
+class WebMediaPlayerClient;
+}
+
+namespace media {
+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 {
+ public:
+ explicit WebMediaPlayerFactory(const scoped_refptr<
+ base::SingleThreadTaskRunner>& compositor_task_runner);
+ ~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_refptr<base::SingleThreadTaskRunner> compositor_task_runner_;
+ base::Thread media_thread_;
+ media::FakeAudioLogFactory fake_audio_log_factory_;
+ scoped_ptr<media::AudioManager> audio_manager_;
+ media::AudioHardwareConfig audio_hardware_config_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerFactory);
+};
+
+} // namespace mojo
+
+#endif // MOJO_SERVICES_HTML_VIEWER_WEBMEDIAPLAYER_FACTORY_H_
« no previous file with comments | « mojo/services/html_viewer/html_viewer.cc ('k') | mojo/services/html_viewer/webmediaplayer_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698