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

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: Move factory ownership to HTMLViewer. 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
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_

Powered by Google App Engine
This is Rietveld 408576698