| 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 WEBKIT_PLUGINS_PPAPI_CONTENT_DECRYPTOR_DELEGATE_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_CONTENT_DECRYPTOR_DELEGATE_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_CONTENT_DECRYPTOR_DELEGATE_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_CONTENT_DECRYPTOR_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 // |plugin_decryption_interface|. Therefore |plugin_decryption_interface| | 36 // |plugin_decryption_interface|. Therefore |plugin_decryption_interface| |
| 37 // must outlive this object. | 37 // must outlive this object. |
| 38 ContentDecryptorDelegate( | 38 ContentDecryptorDelegate( |
| 39 PP_Instance pp_instance, | 39 PP_Instance pp_instance, |
| 40 const PPP_ContentDecryptor_Private* plugin_decryption_interface); | 40 const PPP_ContentDecryptor_Private* plugin_decryption_interface); |
| 41 | 41 |
| 42 void Initialize(const std::string& key_system); | 42 void Initialize(const std::string& key_system); |
| 43 | 43 |
| 44 void SetKeyEventCallbacks(const media::KeyAddedCB& key_added_cb, | 44 void SetKeyEventCallbacks(const media::KeyAddedCB& key_added_cb, |
| 45 const media::KeyErrorCB& key_error_cb, | 45 const media::KeyErrorCB& key_error_cb, |
| 46 const media::KeyMessageCB& key_message_cb, | 46 const media::KeyMessageCB& key_message_cb); |
| 47 const media::NeedKeyCB& need_key_cb); | |
| 48 | 47 |
| 49 // Provides access to PPP_ContentDecryptor_Private. | 48 // Provides access to PPP_ContentDecryptor_Private. |
| 50 bool GenerateKeyRequest(const std::string& type, | 49 bool GenerateKeyRequest(const std::string& type, |
| 51 const uint8* init_data, | 50 const uint8* init_data, |
| 52 int init_data_length); | 51 int init_data_length); |
| 53 bool AddKey(const std::string& session_id, | 52 bool AddKey(const std::string& session_id, |
| 54 const uint8* key, | 53 const uint8* key, |
| 55 int key_length, | 54 int key_length, |
| 56 const uint8* init_data, | 55 const uint8* init_data, |
| 57 int init_data_length); | 56 int init_data_length); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 const PP_Instance pp_instance_; | 130 const PP_Instance pp_instance_; |
| 132 const PPP_ContentDecryptor_Private* const plugin_decryption_interface_; | 131 const PPP_ContentDecryptor_Private* const plugin_decryption_interface_; |
| 133 | 132 |
| 134 // TODO(ddorwin): Remove after updating the Pepper API to not use key system. | 133 // TODO(ddorwin): Remove after updating the Pepper API to not use key system. |
| 135 std::string key_system_; | 134 std::string key_system_; |
| 136 | 135 |
| 137 // Callbacks for firing key events. | 136 // Callbacks for firing key events. |
| 138 media::KeyAddedCB key_added_cb_; | 137 media::KeyAddedCB key_added_cb_; |
| 139 media::KeyErrorCB key_error_cb_; | 138 media::KeyErrorCB key_error_cb_; |
| 140 media::KeyMessageCB key_message_cb_; | 139 media::KeyMessageCB key_message_cb_; |
| 141 media::NeedKeyCB need_key_cb_; | |
| 142 | 140 |
| 143 gfx::Size natural_size_; | 141 gfx::Size natural_size_; |
| 144 | 142 |
| 145 // Request ID for tracking pending content decryption callbacks. | 143 // Request ID for tracking pending content decryption callbacks. |
| 146 // Note that zero indicates an invalid request ID. | 144 // Note that zero indicates an invalid request ID. |
| 147 // TODO(xhwang): Add completion callbacks for Reset/Stop and remove the use | 145 // TODO(xhwang): Add completion callbacks for Reset/Stop and remove the use |
| 148 // of request IDs. | 146 // of request IDs. |
| 149 uint32_t next_decryption_request_id_; | 147 uint32_t next_decryption_request_id_; |
| 150 | 148 |
| 151 uint32_t pending_audio_decrypt_request_id_; | 149 uint32_t pending_audio_decrypt_request_id_; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 175 base::WeakPtrFactory<ContentDecryptorDelegate> weak_ptr_factory_; | 173 base::WeakPtrFactory<ContentDecryptorDelegate> weak_ptr_factory_; |
| 176 base::WeakPtr<ContentDecryptorDelegate> weak_this_; | 174 base::WeakPtr<ContentDecryptorDelegate> weak_this_; |
| 177 | 175 |
| 178 DISALLOW_COPY_AND_ASSIGN(ContentDecryptorDelegate); | 176 DISALLOW_COPY_AND_ASSIGN(ContentDecryptorDelegate); |
| 179 }; | 177 }; |
| 180 | 178 |
| 181 } // namespace ppapi | 179 } // namespace ppapi |
| 182 } // namespace webkit | 180 } // namespace webkit |
| 183 | 181 |
| 184 #endif // WEBKIT_PLUGINS_PPAPI_CONTENT_DECRYPTOR_DELEGATE_H_ | 182 #endif // WEBKIT_PLUGINS_PPAPI_CONTENT_DECRYPTOR_DELEGATE_H_ |
| OLD | NEW |