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 "base/memory/scoped_ptr.h"
10 #include "media/mojo/interfaces/service_factory.mojom.h"
11 #include "media/mojo/services/mojo_cdm_service_context.h"
12 #include "mojo/public/cpp/bindings/strong_binding.h"
16 class ServiceProvider
;
23 class RendererFactory
;
25 class ServiceFactoryImpl
: public interfaces::ServiceFactory
{
27 ServiceFactoryImpl(mojo::InterfaceRequest
<interfaces::ServiceFactory
> request
,
28 mojo::ServiceProvider
* service_provider
,
29 scoped_refptr
<MediaLog
> media_log
,
30 scoped_ptr
<mojo::AppRefCount
> parent_app_refcount
);
31 ~ServiceFactoryImpl() final
;
33 // interfaces::ServiceFactory implementation.
35 mojo::InterfaceRequest
<interfaces::Renderer
> renderer
) final
;
37 mojo::InterfaceRequest
<interfaces::ContentDecryptionModule
> cdm
) final
;
40 RendererFactory
* GetRendererFactory();
41 CdmFactory
* GetCdmFactory();
43 MojoCdmServiceContext cdm_service_context_
;
45 mojo::StrongBinding
<interfaces::ServiceFactory
> binding_
;
46 mojo::ServiceProvider
* service_provider_
;
47 scoped_refptr
<MediaLog
> media_log_
;
48 scoped_ptr
<mojo::AppRefCount
> parent_app_refcount_
;
50 scoped_ptr
<RendererFactory
> renderer_factory_
;
51 scoped_ptr
<CdmFactory
> cdm_factory_
;
53 DISALLOW_COPY_AND_ASSIGN(ServiceFactoryImpl
);
58 #endif // MEDIA_MOJO_SERVICES_SERVICE_FACTORY_IMPL_H_