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

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

Issue 1231623003: media: Support CdmFactory in MojoMediaClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
Index: media/mojo/services/mojo_cdm_service.h
diff --git a/media/mojo/services/mojo_cdm_service.h b/media/mojo/services/mojo_cdm_service.h
index 770b4b8f44170d68e3a5c7cae8eaa9b813bbed74..8d57f90f85cd791b45ca92f99e7b776c3b567cb7 100644
--- a/media/mojo/services/mojo_cdm_service.h
+++ b/media/mojo/services/mojo_cdm_service.h
@@ -11,10 +11,12 @@
#include "base/memory/weak_ptr.h"
#include "media/base/media_keys.h"
#include "media/mojo/interfaces/content_decryption_module.mojom.h"
+#include "media/mojo/services/mojo_cdm_promise.h"
#include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h"
namespace media {
+class CdmFactory;
class MojoCdmServiceContext;
// A mojo::ContentDecryptionModule implementation backed by a media::MediaKeys.
@@ -22,6 +24,7 @@ class MojoCdmService : public mojo::ContentDecryptionModule {
public:
// Constructs a MojoCdmService and strongly binds it to the |request|.
MojoCdmService(MojoCdmServiceContext* context,
+ CdmFactory* cdm_factory,
mojo::InterfaceRequest<mojo::ContentDecryptionModule> request);
~MojoCdmService() final;
@@ -62,6 +65,12 @@ class MojoCdmService : public mojo::ContentDecryptionModule {
CdmContext* GetCdmContext();
private:
+ // Callback for CdmFactory::Create().
+ void OnCdmCreated(int cdm_id,
+ scoped_ptr<MojoCdmPromise<>> promise,
+ scoped_ptr<MediaKeys> cdm,
+ const std::string& error_message);
ddorwin 2015/07/09 18:13:04 Why aren't these parameters part of the promise? I
xhwang 2015/07/09 21:16:31 OnCdmCreated() needs to be bound into CdmCreatedCB
+
// Callbacks for firing session events.
void OnSessionMessage(const std::string& session_id,
MediaKeys::MessageType message_type,
@@ -81,6 +90,8 @@ class MojoCdmService : public mojo::ContentDecryptionModule {
mojo::StrongBinding<mojo::ContentDecryptionModule> binding_;
MojoCdmServiceContext* context_;
+ CdmFactory* cdm_factory_;
+
scoped_ptr<MediaKeys> cdm_;
// Set to a valid CDM ID if the |cdm_| is successfully created.

Powered by Google App Engine
This is Rietveld 408576698