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 <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <string> | 10 #include <string> |
(...skipping 28 matching lines...) Expand all Loading... |
39 public: | 39 public: |
40 // ContentDecryptorDelegate does not take ownership of | 40 // ContentDecryptorDelegate does not take ownership of |
41 // |plugin_decryption_interface|. Therefore |plugin_decryption_interface| | 41 // |plugin_decryption_interface|. Therefore |plugin_decryption_interface| |
42 // must outlive this object. | 42 // must outlive this object. |
43 ContentDecryptorDelegate( | 43 ContentDecryptorDelegate( |
44 PP_Instance pp_instance, | 44 PP_Instance pp_instance, |
45 const PPP_ContentDecryptor_Private* plugin_decryption_interface); | 45 const PPP_ContentDecryptor_Private* plugin_decryption_interface); |
46 ~ContentDecryptorDelegate(); | 46 ~ContentDecryptorDelegate(); |
47 | 47 |
48 // This object should not be accessed after |fatal_plugin_error_cb| is called. | 48 // This object should not be accessed after |fatal_plugin_error_cb| is called. |
49 void Initialize(const std::string& key_system, | 49 void Initialize( |
50 const media::SessionMessageCB& session_message_cb, | 50 const std::string& key_system, |
51 const media::SessionReadyCB& session_ready_cb, | 51 const media::SessionMessageCB& session_message_cb, |
52 const media::SessionClosedCB& session_closed_cb, | 52 const media::SessionReadyCB& session_ready_cb, |
53 const media::SessionErrorCB& session_error_cb, | 53 const media::SessionClosedCB& session_closed_cb, |
54 const base::Closure& fatal_plugin_error_cb); | 54 const media::SessionErrorCB& session_error_cb, |
| 55 const media::SessionKeysChangeCB& session_keys_change_cb, |
| 56 const media::SessionExpirationChangeCB& session_expiration_change_cb, |
| 57 const base::Closure& fatal_plugin_error_cb); |
55 | 58 |
56 void InstanceCrashed(); | 59 void InstanceCrashed(); |
57 | 60 |
58 // Provides access to PPP_ContentDecryptor_Private. | 61 // Provides access to PPP_ContentDecryptor_Private. |
59 void SetServerCertificate(const uint8_t* certificate, | 62 void SetServerCertificate(const uint8_t* certificate, |
60 uint32_t certificate_length, | 63 uint32_t certificate_length, |
61 scoped_ptr<media::SimpleCdmPromise> promise); | 64 scoped_ptr<media::SimpleCdmPromise> promise); |
62 void CreateSession(const std::string& init_data_type, | 65 void CreateSession(const std::string& init_data_type, |
63 const uint8* init_data, | 66 const uint8* init_data, |
64 int init_data_length, | 67 int init_data_length, |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 const PPP_ContentDecryptor_Private* const plugin_decryption_interface_; | 215 const PPP_ContentDecryptor_Private* const plugin_decryption_interface_; |
213 | 216 |
214 // TODO(ddorwin): Remove after updating the Pepper API to not use key system. | 217 // TODO(ddorwin): Remove after updating the Pepper API to not use key system. |
215 std::string key_system_; | 218 std::string key_system_; |
216 | 219 |
217 // Callbacks for firing session events. | 220 // Callbacks for firing session events. |
218 media::SessionMessageCB session_message_cb_; | 221 media::SessionMessageCB session_message_cb_; |
219 media::SessionReadyCB session_ready_cb_; | 222 media::SessionReadyCB session_ready_cb_; |
220 media::SessionClosedCB session_closed_cb_; | 223 media::SessionClosedCB session_closed_cb_; |
221 media::SessionErrorCB session_error_cb_; | 224 media::SessionErrorCB session_error_cb_; |
| 225 media::SessionKeysChangeCB session_keys_change_cb_; |
| 226 media::SessionExpirationChangeCB session_expiration_change_cb_; |
222 | 227 |
223 // Callback to notify that unexpected error happened and |this| should not | 228 // Callback to notify that unexpected error happened and |this| should not |
224 // be used anymore. | 229 // be used anymore. |
225 base::Closure fatal_plugin_error_cb_; | 230 base::Closure fatal_plugin_error_cb_; |
226 | 231 |
227 gfx::Size natural_size_; | 232 gfx::Size natural_size_; |
228 | 233 |
229 // Request ID for tracking pending content decryption callbacks. | 234 // Request ID for tracking pending content decryption callbacks. |
230 // Note that zero indicates an invalid request ID. | 235 // Note that zero indicates an invalid request ID. |
231 // TODO(xhwang): Add completion callbacks for Reset/Stop and remove the use | 236 // TODO(xhwang): Add completion callbacks for Reset/Stop and remove the use |
(...skipping 24 matching lines...) Expand all Loading... |
256 | 261 |
257 base::WeakPtr<ContentDecryptorDelegate> weak_this_; | 262 base::WeakPtr<ContentDecryptorDelegate> weak_this_; |
258 base::WeakPtrFactory<ContentDecryptorDelegate> weak_ptr_factory_; | 263 base::WeakPtrFactory<ContentDecryptorDelegate> weak_ptr_factory_; |
259 | 264 |
260 DISALLOW_COPY_AND_ASSIGN(ContentDecryptorDelegate); | 265 DISALLOW_COPY_AND_ASSIGN(ContentDecryptorDelegate); |
261 }; | 266 }; |
262 | 267 |
263 } // namespace content | 268 } // namespace content |
264 | 269 |
265 #endif // CONTENT_RENDERER_PEPPER_CONTENT_DECRYPTOR_DELEGATE_H_ | 270 #endif // CONTENT_RENDERER_PEPPER_CONTENT_DECRYPTOR_DELEGATE_H_ |
OLD | NEW |