| 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 7bb786908e6dcf56d85a10ee686d487869252567..95231ec2986ca98f905d8763d096d5ac9742daed 100644
|
| --- a/media/mojo/services/mojo_cdm_service.h
|
| +++ b/media/mojo/services/mojo_cdm_service.h
|
| @@ -15,11 +15,17 @@
|
|
|
| namespace media {
|
|
|
| +class MojoCdmServiceContext;
|
| +
|
| // A mojo::ContentDecryptionModule implementation backed by a media::MediaKeys.
|
| class MojoCdmService
|
| : public mojo::InterfaceImpl<mojo::ContentDecryptionModule> {
|
| public:
|
| - MojoCdmService(const mojo::String& key_system);
|
| + // Creates MojoCdmService for |key_system|. Returns nullptr if |key_system| is
|
| + // not supported.
|
| + static MojoCdmService* Create(MojoCdmServiceContext* context,
|
| + const mojo::String& key_system);
|
| +
|
| ~MojoCdmService() final;
|
|
|
| // mojo::ContentDecryptionModule implementation.
|
| @@ -44,10 +50,18 @@ class MojoCdmService
|
| void RemoveSession(
|
| const mojo::String& session_id,
|
| const mojo::Callback<void(mojo::CdmPromiseResultPtr)>& callback) final;
|
| - void GetCdmContext(int32_t cdm_id,
|
| - mojo::InterfaceRequest<mojo::Decryptor> decryptor) final;
|
| + void GetDecryptor(mojo::InterfaceRequest<mojo::Decryptor> decryptor) final;
|
| +
|
| + // Get CdmContext to be used by the media pipeline.
|
| + CdmContext* GetCdmContext();
|
|
|
| private:
|
| + MojoCdmService(MojoCdmServiceContext* context,
|
| + const mojo::String& key_system);
|
| +
|
| + // mojo::InterfaceImpl implementation.
|
| + void OnConnectionError() override;
|
| +
|
| // Callbacks for firing session events.
|
| void OnSessionMessage(const std::string& session_id,
|
| const std::vector<uint8_t>& message,
|
| @@ -62,6 +76,7 @@ class MojoCdmService
|
| uint32_t system_code,
|
| const std::string& error_message);
|
|
|
| + MojoCdmServiceContext* context_;
|
| scoped_ptr<MediaKeys> cdm_;
|
|
|
| base::WeakPtrFactory<MojoCdmService> weak_factory_;
|
|
|