OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MEDIA_MOJO_SERVICES_SERVICE_FACTORY_IMPL_H_ |
| 6 #define MEDIA_MOJO_SERVICES_SERVICE_FACTORY_IMPL_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "media/mojo/interfaces/service_factory.mojom.h" |
| 10 #include "media/mojo/services/mojo_cdm_service_context.h" |
| 11 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 12 |
| 13 namespace mojo { |
| 14 class ServiceProvider; |
| 15 } |
| 16 |
| 17 namespace media { |
| 18 |
| 19 class CdmFactory; |
| 20 class MediaLog; |
| 21 class RendererFactory; |
| 22 |
| 23 class ServiceFactoryImpl : public interfaces::ServiceFactory { |
| 24 public: |
| 25 ServiceFactoryImpl(mojo::InterfaceRequest<interfaces::ServiceFactory> request, |
| 26 mojo::ServiceProvider* service_provider, |
| 27 scoped_refptr<MediaLog> media_log); |
| 28 ~ServiceFactoryImpl() final; |
| 29 |
| 30 // interfaces::ServiceFactory implementation. |
| 31 void CreateRenderer( |
| 32 mojo::InterfaceRequest<interfaces::MediaRenderer> renderer) final; |
| 33 void CreateCdm( |
| 34 mojo::InterfaceRequest<interfaces::ContentDecryptionModule> cdm) final; |
| 35 |
| 36 private: |
| 37 RendererFactory* GetRendererFactory(); |
| 38 CdmFactory* GetCdmFactory(); |
| 39 |
| 40 MojoCdmServiceContext cdm_service_context_; |
| 41 |
| 42 mojo::StrongBinding<interfaces::ServiceFactory> binding_; |
| 43 mojo::ServiceProvider* service_provider_; |
| 44 scoped_refptr<MediaLog> media_log_; |
| 45 |
| 46 scoped_ptr<RendererFactory> renderer_factory_; |
| 47 scoped_ptr<CdmFactory> cdm_factory_; |
| 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(ServiceFactoryImpl); |
| 50 }; |
| 51 |
| 52 } // namespace media |
| 53 |
| 54 #endif // MEDIA_MOJO_SERVICES_SERVICE_FACTORY_IMPL_H_ |
OLD | NEW |