| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_MOJO_SERVICES_SERVICE_FACTORY_IMPL_H_ | 5 #ifndef MEDIA_MOJO_SERVICES_SERVICE_FACTORY_IMPL_H_ |
| 6 #define MEDIA_MOJO_SERVICES_SERVICE_FACTORY_IMPL_H_ | 6 #define MEDIA_MOJO_SERVICES_SERVICE_FACTORY_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "media/mojo/interfaces/service_factory.mojom.h" | 10 #include "media/mojo/interfaces/service_factory.mojom.h" |
| 11 #include "media/mojo/services/mojo_cdm_service_context.h" | 11 #include "media/mojo/services/mojo_cdm_service_context.h" |
| 12 #include "mojo/public/cpp/bindings/strong_binding.h" | 12 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 13 #include "mojo/shell/public/cpp/shell.h" | 13 #include "mojo/shell/public/cpp/connector.h" |
| 14 #include "mojo/shell/public/cpp/message_loop_ref.h" |
| 14 | 15 |
| 15 namespace mojo { | 16 namespace mojo { |
| 16 class AppRefCount; | 17 class MessageLoopRef; |
| 17 namespace shell { | 18 namespace shell { |
| 18 namespace mojom { | 19 namespace mojom { |
| 19 class InterfaceProvider; | 20 class InterfaceProvider; |
| 20 } | 21 } |
| 21 } | 22 } |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace media { | 25 namespace media { |
| 25 | 26 |
| 26 class CdmFactory; | 27 class CdmFactory; |
| 27 class MediaLog; | 28 class MediaLog; |
| 28 class MojoMediaClient; | 29 class MojoMediaClient; |
| 29 class RendererFactory; | 30 class RendererFactory; |
| 30 | 31 |
| 31 class ServiceFactoryImpl : public interfaces::ServiceFactory { | 32 class ServiceFactoryImpl : public interfaces::ServiceFactory { |
| 32 public: | 33 public: |
| 33 ServiceFactoryImpl(mojo::InterfaceRequest<interfaces::ServiceFactory> request, | 34 ServiceFactoryImpl(mojo::InterfaceRequest<interfaces::ServiceFactory> request, |
| 34 mojo::shell::mojom::InterfaceProvider* interfaces, | 35 mojo::shell::mojom::InterfaceProvider* interfaces, |
| 35 scoped_refptr<MediaLog> media_log, | 36 scoped_refptr<MediaLog> media_log, |
| 36 scoped_ptr<mojo::AppRefCount> parent_app_refcount, | 37 scoped_ptr<mojo::MessageLoopRef> parent_app_refcount, |
| 37 MojoMediaClient* mojo_media_client); | 38 MojoMediaClient* mojo_media_client); |
| 38 ~ServiceFactoryImpl() final; | 39 ~ServiceFactoryImpl() final; |
| 39 | 40 |
| 40 // interfaces::ServiceFactory implementation. | 41 // interfaces::ServiceFactory implementation. |
| 41 void CreateRenderer( | 42 void CreateRenderer( |
| 42 mojo::InterfaceRequest<interfaces::Renderer> renderer) final; | 43 mojo::InterfaceRequest<interfaces::Renderer> renderer) final; |
| 43 void CreateCdm( | 44 void CreateCdm( |
| 44 mojo::InterfaceRequest<interfaces::ContentDecryptionModule> cdm) final; | 45 mojo::InterfaceRequest<interfaces::ContentDecryptionModule> cdm) final; |
| 45 | 46 |
| 46 private: | 47 private: |
| 47 RendererFactory* GetRendererFactory(); | 48 RendererFactory* GetRendererFactory(); |
| 48 CdmFactory* GetCdmFactory(); | 49 CdmFactory* GetCdmFactory(); |
| 49 | 50 |
| 50 MojoCdmServiceContext cdm_service_context_; | 51 MojoCdmServiceContext cdm_service_context_; |
| 51 | 52 |
| 52 mojo::StrongBinding<interfaces::ServiceFactory> binding_; | 53 mojo::StrongBinding<interfaces::ServiceFactory> binding_; |
| 53 mojo::shell::mojom::InterfaceProvider* interfaces_; | 54 mojo::shell::mojom::InterfaceProvider* interfaces_; |
| 54 scoped_refptr<MediaLog> media_log_; | 55 scoped_refptr<MediaLog> media_log_; |
| 55 scoped_ptr<mojo::AppRefCount> parent_app_refcount_; | 56 scoped_ptr<mojo::MessageLoopRef> parent_app_refcount_; |
| 56 MojoMediaClient* mojo_media_client_; | 57 MojoMediaClient* mojo_media_client_; |
| 57 | 58 |
| 58 scoped_ptr<RendererFactory> renderer_factory_; | 59 scoped_ptr<RendererFactory> renderer_factory_; |
| 59 scoped_ptr<CdmFactory> cdm_factory_; | 60 scoped_ptr<CdmFactory> cdm_factory_; |
| 60 | 61 |
| 61 DISALLOW_COPY_AND_ASSIGN(ServiceFactoryImpl); | 62 DISALLOW_COPY_AND_ASSIGN(ServiceFactoryImpl); |
| 62 }; | 63 }; |
| 63 | 64 |
| 64 } // namespace media | 65 } // namespace media |
| 65 | 66 |
| 66 #endif // MEDIA_MOJO_SERVICES_SERVICE_FACTORY_IMPL_H_ | 67 #endif // MEDIA_MOJO_SERVICES_SERVICE_FACTORY_IMPL_H_ |
| OLD | NEW |