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

Side by Side Diff: media/mojo/interfaces/content_decryption_module.mojom

Issue 2411573002: media: Use new wrapper types for media mojo interfaces (Closed)
Patch Set: comments addressed Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « media/mojo/interfaces/BUILD.gn ('k') | media/mojo/interfaces/decryptor.mojom » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 module media.mojom; 5 module media.mojom;
6 6
7 import "media/mojo/interfaces/decryptor.mojom"; 7 import "media/mojo/interfaces/decryptor.mojom";
8 import "url/mojo/url.mojom"; 8 import "url/mojo/url.mojom";
9 9
10 // Transport layer of media::MediaKeys::Exception (see media/base/media_keys.h). 10 // Transport layer of media::MediaKeys::Exception (see media/base/media_keys.h).
(...skipping 30 matching lines...) Expand all
41 41
42 // Transport layer of media::CdmPromise (see media/base/cdm_promise.h). 42 // Transport layer of media::CdmPromise (see media/base/cdm_promise.h).
43 // - When |success| is true, the promise is resolved and all other fields should 43 // - When |success| is true, the promise is resolved and all other fields should
44 // be ignored. 44 // be ignored.
45 // - When |success| is false, the promise is rejected with |exception|, 45 // - When |success| is false, the promise is rejected with |exception|,
46 // |system_code| and |error_message|. 46 // |system_code| and |error_message|.
47 struct CdmPromiseResult { 47 struct CdmPromiseResult {
48 bool success; 48 bool success;
49 CdmException exception; 49 CdmException exception;
50 uint32 system_code; 50 uint32 system_code;
51 string? error_message; 51 string error_message;
52 }; 52 };
53 53
54 // Transport layer of media::CdmKeyInformation (see 54 // Transport layer of media::CdmKeyInformation (see
55 // media/base/cdm_key_information.h). It is used to specify a key_id and it's 55 // media/base/cdm_key_information.h). It is used to specify a key_id and it's
56 // associated status. 56 // associated status.
57 struct CdmKeyInformation { 57 struct CdmKeyInformation {
58 array<uint8> key_id; 58 array<uint8> key_id;
59 CdmKeyStatus status; 59 CdmKeyStatus status;
60 uint32 system_code; 60 uint32 system_code;
61 }; 61 };
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 Initialize(string key_system, string security_origin, CdmConfig cdm_config) 96 Initialize(string key_system, string security_origin, CdmConfig cdm_config)
97 => (CdmPromiseResult result, int32 cdm_id, Decryptor? decryptor); 97 => (CdmPromiseResult result, int32 cdm_id, Decryptor? decryptor);
98 98
99 // Provides a server certificate to be used to encrypt messages to the 99 // Provides a server certificate to be used to encrypt messages to the
100 // license server. 100 // license server.
101 SetServerCertificate(array<uint8> certificate_data) 101 SetServerCertificate(array<uint8> certificate_data)
102 => (CdmPromiseResult result); 102 => (CdmPromiseResult result);
103 103
104 // Creates a session with the |init_data_type|, |init_data| and |session_type| 104 // Creates a session with the |init_data_type|, |init_data| and |session_type|
105 // provided. If |result.success| is false, the output |session_id| will be 105 // provided. If |result.success| is false, the output |session_id| will be
106 // null. 106 // empty.
107 CreateSessionAndGenerateRequest(SessionType session_type, 107 CreateSessionAndGenerateRequest(SessionType session_type,
108 InitDataType init_data_type, 108 InitDataType init_data_type,
109 array<uint8> init_data) 109 array<uint8> init_data)
110 => (CdmPromiseResult result, string? session_id); 110 => (CdmPromiseResult result, string session_id);
111 111
112 // Loads the session associated with |session_id| and |session_type|. 112 // Loads the session associated with |session_id| and |session_type|.
113 // Combinations of |result.success| and |session_id| means: 113 // Combinations of |result.success| and |session_id| means:
114 // (true, non-null) : Session successfully loaded. 114 // (true, non-empty) : Session successfully loaded.
115 // (true, null) : Session not found. 115 // (true, empty) : Session not found.
116 // (false, non-null): N/A; this combination is not allowed. 116 // (false, non-empty): N/A; this combination is not allowed.
117 // (false, null) : Unexpected error. See other fields in |result|. 117 // (false, empty) : Unexpected error. See other fields in |result|.
118 LoadSession(SessionType session_type, string session_id) 118 LoadSession(SessionType session_type, string session_id)
119 => (CdmPromiseResult result, string? session_id); 119 => (CdmPromiseResult result, string session_id);
120 120
121 // Updates a session specified by |session_id| with |response|. 121 // Updates a session specified by |session_id| with |response|.
122 UpdateSession(string session_id, array<uint8> response) 122 UpdateSession(string session_id, array<uint8> response)
123 => (CdmPromiseResult result); 123 => (CdmPromiseResult result);
124 124
125 // Closes the session specified by |session_id|. 125 // Closes the session specified by |session_id|.
126 CloseSession(string session_id) => (CdmPromiseResult result); 126 CloseSession(string session_id) => (CdmPromiseResult result);
127 127
128 // Removes stored session data associated with the active session specified by 128 // Removes stored session data associated with the active session specified by
129 // |session_id|. 129 // |session_id|.
130 RemoveSession(string session_id) => (CdmPromiseResult result); 130 RemoveSession(string session_id) => (CdmPromiseResult result);
131 }; 131 };
132 132
133 // Session callbacks. See media/base/media_keys.h for details. 133 // Session callbacks. See media/base/media_keys.h for details.
134 interface ContentDecryptionModuleClient { 134 interface ContentDecryptionModuleClient {
135 OnSessionMessage(string session_id, CdmMessageType message_type, 135 OnSessionMessage(string session_id, CdmMessageType message_type,
136 array<uint8> message); 136 array<uint8> message);
137 137
138 OnSessionClosed(string session_id); 138 OnSessionClosed(string session_id);
139 139
140 OnSessionKeysChange(string session_id, bool has_additional_usable_key, 140 OnSessionKeysChange(string session_id, bool has_additional_usable_key,
141 array<CdmKeyInformation> key_information); 141 array<CdmKeyInformation> keys_info);
142 142
143 // Provide session expiration update for |session_id|. 143 // Provide session expiration update for |session_id|.
144 // |new_expiry_time_sec| is the number of seconds since epoch (Jan 1, 1970). 144 // |new_expiry_time_sec| is the number of seconds since epoch (Jan 1, 1970).
145 OnSessionExpirationUpdate(string session_id, double new_expiry_time_sec); 145 OnSessionExpirationUpdate(string session_id, double new_expiry_time_sec);
146 }; 146 };
OLDNEW
« no previous file with comments | « media/mojo/interfaces/BUILD.gn ('k') | media/mojo/interfaces/decryptor.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698