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

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

Issue 840473002: media: Support creation and SetCdm() for mojo based CDM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only; compiles but needs more polish... Created 5 years, 7 months 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_cdm_service.cc ('k') | media/mojo/services/mojo_cdm_service_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/mojo_cdm_service_context.h
diff --git a/media/mojo/services/mojo_cdm_service_context.h b/media/mojo/services/mojo_cdm_service_context.h
new file mode 100644
index 0000000000000000000000000000000000000000..b94f7cc98ac54e0a8b1c7d8ebf5dc00fec963f40
--- /dev/null
+++ b/media/mojo/services/mojo_cdm_service_context.h
@@ -0,0 +1,47 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_CONTEXT_H_
+#define MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_CONTEXT_H_
+
+#include "base/containers/scoped_ptr_hash_map.h"
+#include "base/macros.h"
+#include "media/base/cdm_context.h"
+#include "media/base/media_export.h"
+#include "media/mojo/services/mojo_cdm_service.h"
+
+namespace media {
+
+// A class that creates, owns and manages all MojoCdmService instances.
+class MEDIA_EXPORT MojoCdmServiceContext : public CdmContextProvider {
+ public:
+ MojoCdmServiceContext();
+ ~MojoCdmServiceContext() override;
+
+ // Creates and returns a MojoCdmService for |key_system|, |security_origin|
+ // and |cdm_id|. The returned MojoCdmService is owned by |this|. Returns
+ // nullptr if no MojoCdmService can be created.
+ MojoCdmService* Create(
+ const mojo::String& key_system,
+ const mojo::String& security_origin,
+ int32_t cdm_id,
+ mojo::InterfaceRequest<mojo::ContentDecryptionModule> request);
+
+ // CdmContextProvider implementation.
+ CdmContext* GetCdmContext(int32_t cdm_id) override;
+
+ // Called when there is a connection error with |service|.
+ void ServiceHadConnectionError(MojoCdmService* service);
+
+ private:
+ // A map between CDM IDs and MojoCdnServices, which owns all MojoCdmServices
+ // created.
+ base::ScopedPtrHashMap<int32_t, scoped_ptr<MojoCdmService>> services_;
+
+ DISALLOW_COPY_AND_ASSIGN(MojoCdmServiceContext);
+};
+
+} // namespace media
+
+#endif // MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_CONTEXT_H_
« no previous file with comments | « media/mojo/services/mojo_cdm_service.cc ('k') | media/mojo/services/mojo_cdm_service_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698