| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "media/mojo/interfaces/service_factory.mojom.h" | 11 #include "media/mojo/interfaces/service_factory.mojom.h" |
| 12 #include "media/mojo/services/mojo_cdm_service_context.h" | 12 #include "media/mojo/services/mojo_cdm_service_context.h" |
| 13 #include "mojo/public/cpp/bindings/strong_binding.h" | 13 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 14 #include "services/shell/public/cpp/connector.h" | 14 #include "services/shell/public/cpp/connector.h" |
| 15 #include "services/shell/public/cpp/shell_connection_ref.h" | 15 #include "services/shell/public/cpp/shell_connection_ref.h" |
| 16 | 16 |
| 17 namespace shell { | 17 namespace shell { |
| 18 namespace mojom { | 18 namespace mojom { |
| 19 class InterfaceProvider; | 19 class InterfaceProvider; |
| 20 } | 20 } |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace media { | 23 namespace media { |
| 24 | 24 |
| 25 class CdmFactory; | 25 class CdmFactory; |
| 26 class MediaLog; | 26 class MediaLog; |
| 27 class MojoMediaClient; | 27 class MojoMediaClient; |
| 28 class RendererFactory; | 28 class RendererFactory; |
| 29 | 29 |
| 30 class ServiceFactoryImpl : public interfaces::ServiceFactory { | 30 class ServiceFactoryImpl : public mojom::ServiceFactory { |
| 31 public: | 31 public: |
| 32 ServiceFactoryImpl(mojo::InterfaceRequest<interfaces::ServiceFactory> request, | 32 ServiceFactoryImpl(mojo::InterfaceRequest<mojom::ServiceFactory> request, |
| 33 shell::mojom::InterfaceProvider* interfaces, | 33 shell::mojom::InterfaceProvider* interfaces, |
| 34 scoped_refptr<MediaLog> media_log, | 34 scoped_refptr<MediaLog> media_log, |
| 35 std::unique_ptr<shell::ShellConnectionRef> connection_ref, | 35 std::unique_ptr<shell::ShellConnectionRef> connection_ref, |
| 36 MojoMediaClient* mojo_media_client); | 36 MojoMediaClient* mojo_media_client); |
| 37 ~ServiceFactoryImpl() final; | 37 ~ServiceFactoryImpl() final; |
| 38 | 38 |
| 39 // interfaces::ServiceFactory implementation. | 39 // mojom::ServiceFactory implementation. |
| 40 void CreateAudioDecoder( | 40 void CreateAudioDecoder( |
| 41 mojo::InterfaceRequest<interfaces::AudioDecoder> audio_decoder) final; | 41 mojo::InterfaceRequest<mojom::AudioDecoder> audio_decoder) final; |
| 42 void CreateRenderer( | 42 void CreateRenderer(mojo::InterfaceRequest<mojom::Renderer> renderer) final; |
| 43 mojo::InterfaceRequest<interfaces::Renderer> renderer) final; | |
| 44 void CreateCdm( | 43 void CreateCdm( |
| 45 mojo::InterfaceRequest<interfaces::ContentDecryptionModule> cdm) final; | 44 mojo::InterfaceRequest<mojom::ContentDecryptionModule> cdm) final; |
| 46 | 45 |
| 47 private: | 46 private: |
| 48 #if defined(ENABLE_MOJO_RENDERER) | 47 #if defined(ENABLE_MOJO_RENDERER) |
| 49 RendererFactory* GetRendererFactory(); | 48 RendererFactory* GetRendererFactory(); |
| 50 | 49 |
| 51 std::unique_ptr<RendererFactory> renderer_factory_; | 50 std::unique_ptr<RendererFactory> renderer_factory_; |
| 52 #endif // defined(ENABLE_MOJO_RENDERER) | 51 #endif // defined(ENABLE_MOJO_RENDERER) |
| 53 | 52 |
| 54 #if defined(ENABLE_MOJO_CDM) | 53 #if defined(ENABLE_MOJO_CDM) |
| 55 CdmFactory* GetCdmFactory(); | 54 CdmFactory* GetCdmFactory(); |
| 56 | 55 |
| 57 std::unique_ptr<CdmFactory> cdm_factory_; | 56 std::unique_ptr<CdmFactory> cdm_factory_; |
| 58 #endif // defined(ENABLE_MOJO_CDM) | 57 #endif // defined(ENABLE_MOJO_CDM) |
| 59 | 58 |
| 60 MojoCdmServiceContext cdm_service_context_; | 59 MojoCdmServiceContext cdm_service_context_; |
| 61 mojo::StrongBinding<interfaces::ServiceFactory> binding_; | 60 mojo::StrongBinding<mojom::ServiceFactory> binding_; |
| 62 shell::mojom::InterfaceProvider* interfaces_; | 61 shell::mojom::InterfaceProvider* interfaces_; |
| 63 scoped_refptr<MediaLog> media_log_; | 62 scoped_refptr<MediaLog> media_log_; |
| 64 std::unique_ptr<shell::ShellConnectionRef> connection_ref_; | 63 std::unique_ptr<shell::ShellConnectionRef> connection_ref_; |
| 65 MojoMediaClient* mojo_media_client_; | 64 MojoMediaClient* mojo_media_client_; |
| 66 | 65 |
| 67 DISALLOW_COPY_AND_ASSIGN(ServiceFactoryImpl); | 66 DISALLOW_COPY_AND_ASSIGN(ServiceFactoryImpl); |
| 68 }; | 67 }; |
| 69 | 68 |
| 70 } // namespace media | 69 } // namespace media |
| 71 | 70 |
| 72 #endif // MEDIA_MOJO_SERVICES_SERVICE_FACTORY_IMPL_H_ | 71 #endif // MEDIA_MOJO_SERVICES_SERVICE_FACTORY_IMPL_H_ |
| OLD | NEW |