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