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 | 13 |
14 namespace mojo { | 14 namespace mojo { |
15 class AppRefCount; | 15 class AppRefCount; |
16 class ServiceProvider; | 16 class InterfaceProvider; |
17 } | 17 } |
18 | 18 |
19 namespace media { | 19 namespace media { |
20 | 20 |
21 class CdmFactory; | 21 class CdmFactory; |
22 class MediaLog; | 22 class MediaLog; |
23 class MojoMediaClient; | 23 class MojoMediaClient; |
24 class RendererFactory; | 24 class RendererFactory; |
25 | 25 |
26 class ServiceFactoryImpl : public interfaces::ServiceFactory { | 26 class ServiceFactoryImpl : public interfaces::ServiceFactory { |
27 public: | 27 public: |
28 ServiceFactoryImpl(mojo::InterfaceRequest<interfaces::ServiceFactory> request, | 28 ServiceFactoryImpl(mojo::InterfaceRequest<interfaces::ServiceFactory> request, |
29 mojo::ServiceProvider* service_provider, | 29 mojo::InterfaceProvider* interfaces, |
30 scoped_refptr<MediaLog> media_log, | 30 scoped_refptr<MediaLog> media_log, |
31 scoped_ptr<mojo::AppRefCount> parent_app_refcount, | 31 scoped_ptr<mojo::AppRefCount> parent_app_refcount, |
32 MojoMediaClient* mojo_media_client); | 32 MojoMediaClient* mojo_media_client); |
33 ~ServiceFactoryImpl() final; | 33 ~ServiceFactoryImpl() final; |
34 | 34 |
35 // interfaces::ServiceFactory implementation. | 35 // interfaces::ServiceFactory implementation. |
36 void CreateRenderer( | 36 void CreateRenderer( |
37 mojo::InterfaceRequest<interfaces::Renderer> renderer) final; | 37 mojo::InterfaceRequest<interfaces::Renderer> renderer) final; |
38 void CreateCdm( | 38 void CreateCdm( |
39 mojo::InterfaceRequest<interfaces::ContentDecryptionModule> cdm) final; | 39 mojo::InterfaceRequest<interfaces::ContentDecryptionModule> cdm) final; |
40 | 40 |
41 private: | 41 private: |
42 RendererFactory* GetRendererFactory(); | 42 RendererFactory* GetRendererFactory(); |
43 CdmFactory* GetCdmFactory(); | 43 CdmFactory* GetCdmFactory(); |
44 | 44 |
45 MojoCdmServiceContext cdm_service_context_; | 45 MojoCdmServiceContext cdm_service_context_; |
46 | 46 |
47 mojo::StrongBinding<interfaces::ServiceFactory> binding_; | 47 mojo::StrongBinding<interfaces::ServiceFactory> binding_; |
48 mojo::ServiceProvider* service_provider_; | 48 mojo::InterfaceProvider* interfaces_; |
49 scoped_refptr<MediaLog> media_log_; | 49 scoped_refptr<MediaLog> media_log_; |
50 scoped_ptr<mojo::AppRefCount> parent_app_refcount_; | 50 scoped_ptr<mojo::AppRefCount> parent_app_refcount_; |
51 MojoMediaClient* mojo_media_client_; | 51 MojoMediaClient* mojo_media_client_; |
52 | 52 |
53 scoped_ptr<RendererFactory> renderer_factory_; | 53 scoped_ptr<RendererFactory> renderer_factory_; |
54 scoped_ptr<CdmFactory> cdm_factory_; | 54 scoped_ptr<CdmFactory> cdm_factory_; |
55 | 55 |
56 DISALLOW_COPY_AND_ASSIGN(ServiceFactoryImpl); | 56 DISALLOW_COPY_AND_ASSIGN(ServiceFactoryImpl); |
57 }; | 57 }; |
58 | 58 |
59 } // namespace media | 59 } // namespace media |
60 | 60 |
61 #endif // MEDIA_MOJO_SERVICES_SERVICE_FACTORY_IMPL_H_ | 61 #endif // MEDIA_MOJO_SERVICES_SERVICE_FACTORY_IMPL_H_ |
OLD | NEW |