Chromium Code Reviews| Index: media/mojo/interfaces/content_decryption_module.mojom |
| diff --git a/media/mojo/interfaces/content_decryption_module.mojom b/media/mojo/interfaces/content_decryption_module.mojom |
| index fc98ff90f1cc4fa8ca3042b4b0b982a922869a0f..34546870fa0f0b7d7ee61770648a09b23d23bad0 100644 |
| --- a/media/mojo/interfaces/content_decryption_module.mojom |
| +++ b/media/mojo/interfaces/content_decryption_module.mojom |
| @@ -7,30 +7,13 @@ module media.mojom; |
| import "media/mojo/interfaces/decryptor.mojom"; |
| import "url/mojo/url.mojom"; |
| -// Transport layer of media::MediaKeys::Exception (see media/base/media_keys.h). |
| -// This is used for ContentDecryptionModule (CDM) promise rejections. |
| -enum CdmException { |
| - NOT_SUPPORTED_ERROR, |
| - INVALID_STATE_ERROR, |
| - INVALID_ACCESS_ERROR, |
| - QUOTA_EXCEEDED_ERROR, |
| - UNKNOWN_ERROR, |
| - CLIENT_ERROR, |
| - OUTPUT_ERROR |
| -}; |
| +// See media::EmeInitDataType. |
| +[Native] |
| +enum EmeInitDataType; |
|
jrummell
2016/10/17 23:47:24
I'm curious why this is outside interface ContentD
xhwang
2016/10/17 23:51:14
Because the C++ media::EmeInitDataType is declared
|
| // Transport layer of media::CdmKeyInformation::KeyStatus (see |
| // media/base/cdm_key_information.h). This is used for indicating the status |
| // of a specific key ID. |
|
jrummell
2016/10/17 23:47:24
I think this comment should be deleted.
xhwang
2016/10/17 23:51:14
oops, thanks for catching that
done
|
| -enum CdmKeyStatus { |
| - USABLE, |
| - INTERNAL_ERROR, |
| - EXPIRED, |
| - OUTPUT_RESTRICTED, |
| - OUTPUT_DOWNSCALED, |
| - KEY_STATUS_PENDING, |
| - RELEASED |
| -}; |
| // Transport layer of media::CdmConfig (see media/base/cdm_config.h). |
| struct CdmConfig { |
| @@ -45,8 +28,12 @@ struct CdmConfig { |
| // - When |success| is false, the promise is rejected with |exception|, |
| // |system_code| and |error_message|. |
| struct CdmPromiseResult { |
| + // See media::MediaKeys::Exception |
| + [Native] |
| + enum Exception; |
| + |
| bool success; |
| - CdmException exception; |
| + Exception exception; |
| uint32 system_code; |
| string error_message; |
| }; |
| @@ -55,35 +42,20 @@ struct CdmPromiseResult { |
| // media/base/cdm_key_information.h). It is used to specify a key_id and it's |
| // associated status. |
| struct CdmKeyInformation { |
| + [Native] |
| + enum KeyStatus; |
| + |
| array<uint8> key_id; |
| - CdmKeyStatus status; |
| + KeyStatus status; |
| uint32 system_code; |
| }; |
| -// See media::MediaKeys::MessageType |
| -enum CdmMessageType { |
| - LICENSE_REQUEST, |
| - LICENSE_RENEWAL, |
| - LICENSE_RELEASE |
| -}; |
| - |
| // An interface that represents a CDM in the Encrypted Media Extensions (EME) |
| // spec (https://w3c.github.io/encrypted-media/). See media/base/media_keys.h. |
| interface ContentDecryptionModule { |
| - // See media::MediaKeys::SessionType. |
| - enum SessionType { |
| - TEMPORARY_SESSION, |
| - PERSISTENT_LICENSE_SESSION, |
| - PERSISTENT_RELEASE_MESSAGE_SESSION |
| - }; |
| - |
| - // See media::EmeInitDataType. |
| - enum InitDataType { |
| - UNKNOWN, |
| - WEBM, |
| - CENC, |
| - KEYIDS |
| - }; |
| + // See media::MediaKeys::SessionType |
| + [Native] |
| + enum SessionType; |
| // Sets ContentDecryptionModuleClient. Must be called before any other calls. |
| SetClient(ContentDecryptionModuleClient client); |
| @@ -105,7 +77,7 @@ interface ContentDecryptionModule { |
| // provided. If |result.success| is false, the output |session_id| will be |
| // empty. |
| CreateSessionAndGenerateRequest(SessionType session_type, |
| - InitDataType init_data_type, |
| + EmeInitDataType init_data_type, |
| array<uint8> init_data) |
| => (CdmPromiseResult result, string session_id); |
| @@ -132,7 +104,11 @@ interface ContentDecryptionModule { |
| // Session callbacks. See media/base/media_keys.h for details. |
| interface ContentDecryptionModuleClient { |
| - OnSessionMessage(string session_id, CdmMessageType message_type, |
| + // See media::MediaKeys::MessageType |
| + [Native] |
| + enum MessageType; |
| + |
| + OnSessionMessage(string session_id, MessageType message_type, |
| array<uint8> message); |
| OnSessionClosed(string session_id); |