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.
5 #ifndef MEDIA_MOJO_SERVICES_SERVICE_FACTORY_IMPL_H_
6 #define MEDIA_MOJO_SERVICES_SERVICE_FACTORY_IMPL_H_
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"
14 class ServiceProvider
;
21 class RendererFactory
;
23 class ServiceFactoryImpl
: public interfaces::ServiceFactory
{
25 ServiceFactoryImpl(mojo::InterfaceRequest
<interfaces::ServiceFactory
> request
,
26 mojo::ServiceProvider
* service_provider
,
27 scoped_refptr
<MediaLog
> media_log
);
28 ~ServiceFactoryImpl() final
;
30 // interfaces::ServiceFactory implementation.
32 mojo::InterfaceRequest
<interfaces::MediaRenderer
> renderer
) final
;
34 mojo::InterfaceRequest
<interfaces::ContentDecryptionModule
> cdm
) final
;
37 RendererFactory
* GetRendererFactory();
38 CdmFactory
* GetCdmFactory();
40 MojoCdmServiceContext cdm_service_context_
;
42 mojo::StrongBinding
<interfaces::ServiceFactory
> binding_
;
43 mojo::ServiceProvider
* service_provider_
;
44 scoped_refptr
<MediaLog
> media_log_
;
46 scoped_ptr
<RendererFactory
> renderer_factory_
;
47 scoped_ptr
<CdmFactory
> cdm_factory_
;
49 DISALLOW_COPY_AND_ASSIGN(ServiceFactoryImpl
);
54 #endif // MEDIA_MOJO_SERVICES_SERVICE_FACTORY_IMPL_H_