Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(630)

Unified Diff: media/mojo/services/service_factory_impl.h

Issue 1541943002: Delete media::Interfaces::ServiceFactory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add service bundle Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/mojo/services/mojo_renderer_service.cc ('k') | media/mojo/services/service_factory_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/service_factory_impl.h
diff --git a/media/mojo/services/service_factory_impl.h b/media/mojo/services/service_factory_impl.h
index 494f4c01e91566b20687b1e4560d0ebb8c8acc91..85da957ad48232c4d3f6501936e94ac6ca103ed8 100644
--- a/media/mojo/services/service_factory_impl.h
+++ b/media/mojo/services/service_factory_impl.h
@@ -7,14 +7,15 @@
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
-#include "media/mojo/interfaces/service_factory.mojom.h"
+#include "media/mojo/interfaces/content_decryption_module.mojom.h"
+#include "media/mojo/interfaces/renderer.mojom.h"
#include "media/mojo/services/mojo_cdm_service_context.h"
-#include "mojo/public/cpp/bindings/strong_binding.h"
+#include "mojo/application/public/cpp/interface_factory.h"
namespace mojo {
-class AppRefCount;
+class ApplicationImpl;
class ServiceProvider;
-}
+} // namespace mojo
namespace media {
@@ -23,35 +24,39 @@ class MediaLog;
class MojoMediaClient;
class RendererFactory;
-class ServiceFactoryImpl : public interfaces::ServiceFactory {
+class ServiceFactoryImpl
+ : public mojo::InterfaceFactory<interfaces::Renderer>,
+ public mojo::InterfaceFactory<interfaces::ContentDecryptionModule> {
public:
- ServiceFactoryImpl(mojo::InterfaceRequest<interfaces::ServiceFactory> request,
- mojo::ServiceProvider* service_provider,
- scoped_refptr<MediaLog> media_log,
- scoped_ptr<mojo::AppRefCount> parent_app_refcount,
- MojoMediaClient* mojo_media_client);
- ~ServiceFactoryImpl() final;
-
- // interfaces::ServiceFactory implementation.
- void CreateRenderer(
- mojo::InterfaceRequest<interfaces::Renderer> renderer) final;
- void CreateCdm(
- mojo::InterfaceRequest<interfaces::ContentDecryptionModule> cdm) final;
+ ServiceFactoryImpl(scoped_ptr<MojoMediaClient> mojo_media_client,
+ scoped_refptr<MediaLog> media_log);
+ ~ServiceFactoryImpl() override;
+
+ void Initialize(mojo::ApplicationImpl* app);
+
+ // mojo::InterfaceFactory<interfaces::Renderer> implementation.
+ void Create(mojo::ApplicationConnection* connection,
+ mojo::InterfaceRequest<interfaces::Renderer> request) final;
+ // mojo::InterfaceFactory<interfaces::ContentDecryptionModule> implementation.
+ void Create(mojo::ApplicationConnection* connection,
+ mojo::InterfaceRequest<interfaces::ContentDecryptionModule>
+ request) final;
private:
- RendererFactory* GetRendererFactory();
- CdmFactory* GetCdmFactory();
+ struct ServiceBundle;
+ ServiceBundle* GetOrCreateServiceBundle(const std::string& url);
+ void OnServiceBundleEmpty(const std::string& url);
- MojoCdmServiceContext cdm_service_context_;
+ RendererFactory* GetRendererFactory();
+ CdmFactory* GetCdmFactory(mojo::ServiceProvider* service_provider);
- mojo::StrongBinding<interfaces::ServiceFactory> binding_;
- mojo::ServiceProvider* service_provider_;
+ mojo::ApplicationImpl* app_;
+ scoped_ptr<MojoMediaClient> mojo_media_client_;
scoped_refptr<MediaLog> media_log_;
- scoped_ptr<mojo::AppRefCount> parent_app_refcount_;
- MojoMediaClient* mojo_media_client_;
- scoped_ptr<RendererFactory> renderer_factory_;
scoped_ptr<CdmFactory> cdm_factory_;
+ scoped_ptr<RendererFactory> renderer_factory_;
+ std::map<std::string, scoped_ptr<ServiceBundle>> service_bundle_map_;
DISALLOW_COPY_AND_ASSIGN(ServiceFactoryImpl);
};
« no previous file with comments | « media/mojo/services/mojo_renderer_service.cc ('k') | media/mojo/services/service_factory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698