OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_RENDERER_PEPPER_CONTENT_DECRYPTOR_DELEGATE_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_CONTENT_DECRYPTOR_DELEGATE_H_ |
6 #define CONTENT_RENDERER_PEPPER_CONTENT_DECRYPTOR_DELEGATE_H_ | 6 #define CONTENT_RENDERER_PEPPER_CONTENT_DECRYPTOR_DELEGATE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 const PPP_ContentDecryptor_Private* plugin_decryption_interface); | 49 const PPP_ContentDecryptor_Private* plugin_decryption_interface); |
50 ~ContentDecryptorDelegate(); | 50 ~ContentDecryptorDelegate(); |
51 | 51 |
52 // This object should not be accessed after |fatal_plugin_error_cb| is called. | 52 // This object should not be accessed after |fatal_plugin_error_cb| is called. |
53 void Initialize( | 53 void Initialize( |
54 const std::string& key_system, | 54 const std::string& key_system, |
55 bool allow_distinctive_identifier, | 55 bool allow_distinctive_identifier, |
56 bool allow_persistent_state, | 56 bool allow_persistent_state, |
57 const media::SessionMessageCB& session_message_cb, | 57 const media::SessionMessageCB& session_message_cb, |
58 const media::SessionClosedCB& session_closed_cb, | 58 const media::SessionClosedCB& session_closed_cb, |
59 const media::LegacySessionErrorCB& legacy_session_error_cb, | |
60 const media::SessionKeysChangeCB& session_keys_change_cb, | 59 const media::SessionKeysChangeCB& session_keys_change_cb, |
61 const media::SessionExpirationUpdateCB& session_expiration_update_cb, | 60 const media::SessionExpirationUpdateCB& session_expiration_update_cb, |
62 const base::Closure& fatal_plugin_error_cb, | 61 const base::Closure& fatal_plugin_error_cb, |
63 std::unique_ptr<media::SimpleCdmPromise> promise); | 62 std::unique_ptr<media::SimpleCdmPromise> promise); |
64 | 63 |
65 void InstanceCrashed(); | 64 void InstanceCrashed(); |
66 | 65 |
67 // Provides access to PPP_ContentDecryptor_Private. | 66 // Provides access to PPP_ContentDecryptor_Private. |
68 void SetServerCertificate(const std::vector<uint8_t>& certificate, | 67 void SetServerCertificate(const std::vector<uint8_t>& certificate, |
69 std::unique_ptr<media::SimpleCdmPromise> promise); | 68 std::unique_ptr<media::SimpleCdmPromise> promise); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 105 |
107 // PPB_ContentDecryptor_Private dispatching methods. | 106 // PPB_ContentDecryptor_Private dispatching methods. |
108 void OnPromiseResolved(uint32_t promise_id); | 107 void OnPromiseResolved(uint32_t promise_id); |
109 void OnPromiseResolvedWithSession(uint32_t promise_id, PP_Var session_id); | 108 void OnPromiseResolvedWithSession(uint32_t promise_id, PP_Var session_id); |
110 void OnPromiseRejected(uint32_t promise_id, | 109 void OnPromiseRejected(uint32_t promise_id, |
111 PP_CdmExceptionCode exception_code, | 110 PP_CdmExceptionCode exception_code, |
112 uint32_t system_code, | 111 uint32_t system_code, |
113 PP_Var error_description); | 112 PP_Var error_description); |
114 void OnSessionMessage(PP_Var session_id, | 113 void OnSessionMessage(PP_Var session_id, |
115 PP_CdmMessageType message_type, | 114 PP_CdmMessageType message_type, |
116 PP_Var message, | 115 PP_Var message); |
117 PP_Var legacy_destination_url); | |
118 void OnSessionKeysChange(PP_Var session_id, | 116 void OnSessionKeysChange(PP_Var session_id, |
119 PP_Bool has_additional_usable_key, | 117 PP_Bool has_additional_usable_key, |
120 uint32_t key_count, | 118 uint32_t key_count, |
121 const struct PP_KeyInformation key_information[]); | 119 const struct PP_KeyInformation key_information[]); |
122 void OnSessionExpirationChange(PP_Var session_id, PP_Time new_expiry_time); | 120 void OnSessionExpirationChange(PP_Var session_id, PP_Time new_expiry_time); |
123 void OnSessionClosed(PP_Var session_id); | 121 void OnSessionClosed(PP_Var session_id); |
124 void OnLegacySessionError(PP_Var session_id, | |
125 PP_CdmExceptionCode exception_code, | |
126 uint32_t system_code, | |
127 PP_Var error_description); | |
128 void DeliverBlock(PP_Resource decrypted_block, | 122 void DeliverBlock(PP_Resource decrypted_block, |
129 const PP_DecryptedBlockInfo* block_info); | 123 const PP_DecryptedBlockInfo* block_info); |
130 void DecoderInitializeDone(PP_DecryptorStreamType decoder_type, | 124 void DecoderInitializeDone(PP_DecryptorStreamType decoder_type, |
131 uint32_t request_id, | 125 uint32_t request_id, |
132 PP_Bool success); | 126 PP_Bool success); |
133 void DecoderDeinitializeDone(PP_DecryptorStreamType decoder_type, | 127 void DecoderDeinitializeDone(PP_DecryptorStreamType decoder_type, |
134 uint32_t request_id); | 128 uint32_t request_id); |
135 void DecoderResetDone(PP_DecryptorStreamType decoder_type, | 129 void DecoderResetDone(PP_DecryptorStreamType decoder_type, |
136 uint32_t request_id); | 130 uint32_t request_id); |
137 void DeliverFrame(PP_Resource decrypted_frame, | 131 void DeliverFrame(PP_Resource decrypted_frame, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 198 |
205 const PP_Instance pp_instance_; | 199 const PP_Instance pp_instance_; |
206 const PPP_ContentDecryptor_Private* const plugin_decryption_interface_; | 200 const PPP_ContentDecryptor_Private* const plugin_decryption_interface_; |
207 | 201 |
208 // TODO(ddorwin): Remove after updating the Pepper API to not use key system. | 202 // TODO(ddorwin): Remove after updating the Pepper API to not use key system. |
209 std::string key_system_; | 203 std::string key_system_; |
210 | 204 |
211 // Callbacks for firing session events. | 205 // Callbacks for firing session events. |
212 media::SessionMessageCB session_message_cb_; | 206 media::SessionMessageCB session_message_cb_; |
213 media::SessionClosedCB session_closed_cb_; | 207 media::SessionClosedCB session_closed_cb_; |
214 media::LegacySessionErrorCB legacy_session_error_cb_; | |
215 media::SessionKeysChangeCB session_keys_change_cb_; | 208 media::SessionKeysChangeCB session_keys_change_cb_; |
216 media::SessionExpirationUpdateCB session_expiration_update_cb_; | 209 media::SessionExpirationUpdateCB session_expiration_update_cb_; |
217 | 210 |
218 // Callback to notify that unexpected error happened and |this| should not | 211 // Callback to notify that unexpected error happened and |this| should not |
219 // be used anymore. | 212 // be used anymore. |
220 base::Closure fatal_plugin_error_cb_; | 213 base::Closure fatal_plugin_error_cb_; |
221 | 214 |
222 gfx::Size natural_size_; | 215 gfx::Size natural_size_; |
223 | 216 |
224 // Request ID for tracking pending content decryption callbacks. | 217 // Request ID for tracking pending content decryption callbacks. |
(...skipping 24 matching lines...) Expand all Loading... |
249 | 242 |
250 base::WeakPtr<ContentDecryptorDelegate> weak_this_; | 243 base::WeakPtr<ContentDecryptorDelegate> weak_this_; |
251 base::WeakPtrFactory<ContentDecryptorDelegate> weak_ptr_factory_; | 244 base::WeakPtrFactory<ContentDecryptorDelegate> weak_ptr_factory_; |
252 | 245 |
253 DISALLOW_COPY_AND_ASSIGN(ContentDecryptorDelegate); | 246 DISALLOW_COPY_AND_ASSIGN(ContentDecryptorDelegate); |
254 }; | 247 }; |
255 | 248 |
256 } // namespace content | 249 } // namespace content |
257 | 250 |
258 #endif // CONTENT_RENDERER_PEPPER_CONTENT_DECRYPTOR_DELEGATE_H_ | 251 #endif // CONTENT_RENDERER_PEPPER_CONTENT_DECRYPTOR_DELEGATE_H_ |
OLD | NEW |