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

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

Issue 795193003: Introduce MojoRendererFactory::ServiceProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 6 years 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 | « media/mojo/services/mojo_renderer_factory.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/html_viewer/webmediaplayer_factory.cc
diff --git a/mojo/services/html_viewer/webmediaplayer_factory.cc b/mojo/services/html_viewer/webmediaplayer_factory.cc
index 7f067545a6418e370fead2b004d8425fbead1f38..084cd736c9b19aaa9e4c21c30efa9cbff632b316 100644
--- a/mojo/services/html_viewer/webmediaplayer_factory.cc
+++ b/mojo/services/html_viewer/webmediaplayer_factory.cc
@@ -25,6 +25,29 @@
namespace mojo {
+#if !defined(OS_ANDROID)
+namespace {
+
+class RendererServiceProvider
+ : public media::MojoRendererFactory::ServiceProvider {
+ public:
+ explicit RendererServiceProvider(ServiceProviderPtr service_provider_ptr)
+ : service_provider_ptr_(service_provider_ptr.Pass()) {}
+ ~RendererServiceProvider() final {}
+
+ void ConnectToService(InterfacePtr<MediaRenderer>* media_renderer_ptr) final {
+ mojo::ConnectToService(service_provider_ptr_.get(), media_renderer_ptr);
+ }
+
+ private:
+ ServiceProviderPtr service_provider_ptr_;
+
+ DISALLOW_COPY_AND_ASSIGN(RendererServiceProvider);
+};
+
+} // namespace
+#endif
+
WebMediaPlayerFactory::WebMediaPlayerFactory(
const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner,
bool enable_mojo_media_renderer)
@@ -62,8 +85,8 @@ blink::WebMediaPlayer* WebMediaPlayerFactory::CreateMediaPlayer(
ServiceProviderPtr media_renderer_service_provider;
shell->ConnectToApplication("mojo:media",
GetProxy(&media_renderer_service_provider));
- media_renderer_factory.reset(
- new media::MojoRendererFactory(media_renderer_service_provider.Pass()));
+ media_renderer_factory.reset(new media::MojoRendererFactory(make_scoped_ptr(
+ new RendererServiceProvider(media_renderer_service_provider.Pass()))));
} else {
media_renderer_factory.reset(
new media::DefaultRendererFactory(media_log,
« no previous file with comments | « media/mojo/services/mojo_renderer_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698