Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 module mojo; | |
|
jamesr
2014/12/02 22:25:59
shouldn't this be in a media module? or perhaps so
xhwang
2014/12/03 01:23:42
The MediaRenderer interface is in mojo module and
| |
| 6 | |
| 7 import "media/mojo/interfaces/decryptor.mojom"; | |
| 8 | |
| 9 enum CdmException { | |
| 10 NOT_SUPPORTED_ERROR, | |
| 11 INVALID_STATE_ERROR, | |
| 12 INVALID_ACCESS_ERROR, | |
| 13 QUOTA_EXCEEDED_ERROR, | |
| 14 UNKNOWN_ERROR, | |
| 15 CLIENT_ERROR, | |
| 16 OUTPUT_ERROR | |
| 17 }; | |
| 18 | |
| 19 struct CdmContext { | |
| 20 Decryptor? decryptor; | |
|
jamesr
2014/12/02 22:25:59
can you add some comments to these guys? what does
xhwang
2014/12/03 01:23:42
Done.
| |
| 21 int32 cdm_id; | |
| 22 }; | |
| 23 | |
| 24 struct CdmPromiseResult { | |
| 25 bool success; | |
| 26 CdmException exception_code; | |
| 27 uint32 system_code; | |
| 28 string error_message; | |
| 29 }; | |
| 30 | |
| 31 [Client=ContentDecryptionModuleClient] | |
| 32 interface ContentDecryptionModule { | |
| 33 enum SessionType { | |
| 34 TEMPORARY_SESSION, | |
| 35 PERSISTENT_SESSION | |
| 36 }; | |
| 37 | |
| 38 // Provides a server certificate to be used to encrypt messages to the | |
| 39 // license server. | |
| 40 SetServerCertificate(array<uint8> certificate_data) | |
| 41 => (CdmPromiseResult result); | |
| 42 | |
| 43 // Creates a session with the |init_data_type|, |init_data| and |session_type| | |
| 44 // provided. | |
| 45 CreateSession(string init_data_type, | |
| 46 array<uint8> init_data, | |
| 47 SessionType session_type) | |
| 48 => (CdmPromiseResult result, string? session_id); | |
| 49 | |
| 50 // Loads a session with the |session_id| provided. | |
| 51 LoadSession(string session_id) | |
| 52 => (CdmPromiseResult result, string? session_id); | |
|
jamesr
2014/12/02 22:25:59
what does it mean for session_id to be null?
xhwang
2014/12/03 01:23:42
Done.
| |
| 53 | |
| 54 // Updates a session specified by |session_id| with |response|. | |
| 55 UpdateSession(string session_id, array<uint8> response) | |
| 56 => (CdmPromiseResult result); | |
| 57 | |
| 58 // Closes the session specified by |session_id|. | |
| 59 CloseSession(string session_id) => (CdmPromiseResult result); | |
| 60 | |
| 61 // Removes stored session data associated with the session specified by | |
| 62 // |session_id|. | |
| 63 RemoveSession(string session_id) => (CdmPromiseResult result); | |
| 64 | |
| 65 // Retrieves the key IDs for keys in the session that the CDM knows are | |
| 66 // currently usable to decrypt media data. | |
| 67 GetUsableKeyIds(string session_id) | |
| 68 => (CdmPromiseResult result, array<array<uint8>>? usable_key_ids); | |
| 69 | |
| 70 // Retrieves the CdmContext associated with this CDM instance. | |
| 71 GetCdmContext(CdmContext& cdm_context); | |
| 72 }; | |
| 73 | |
| 74 interface ContentDecryptionModuleClient { | |
| 75 OnSessionMessage(string session_id, array<uint8> message, | |
| 76 string destination_url); | |
| 77 | |
| 78 OnSessionReady(string session_id); | |
| 79 | |
| 80 OnSessionClosed(string session_id); | |
| 81 | |
| 82 OnSessionError(string session_id, CdmException exception_code, | |
| 83 uint32 system_code, string error_message); | |
| 84 | |
| 85 OnSessionKeysChange(string session_id, bool has_additional_usable_key); | |
| 86 | |
| 87 OnSessionExpirationUpdate(string session_id, int64 new_expiry_time_usec); | |
| 88 }; | |
| OLD | NEW |