Index: webkit/media/crypto/ppapi_decryptor.h |
diff --git a/webkit/media/crypto/ppapi_decryptor.h b/webkit/media/crypto/ppapi_decryptor.h |
index 63b536bdb5e2029df28e9168b5fc4b81f103d286..349d696abbc218e9103315a86ebb8c4579b3bc18 100644 |
--- a/webkit/media/crypto/ppapi_decryptor.h |
+++ b/webkit/media/crypto/ppapi_decryptor.h |
@@ -35,8 +35,11 @@ namespace webkit_media { |
class PpapiDecryptor : public media::Decryptor { |
public: |
PpapiDecryptor( |
- media::DecryptorClient* client, |
- const scoped_refptr<webkit::ppapi::PluginInstance>& plugin_instance); |
+ const scoped_refptr<webkit::ppapi::PluginInstance>& plugin_instance, |
+ const media::KeyAddedCB& key_added_cb, |
+ const media::KeyErrorCB& key_error_cb, |
+ const media::KeyMessageCB& key_message_cb, |
+ const media::NeedKeyCB& need_key_cb); |
virtual ~PpapiDecryptor(); |
// media::Decryptor implementation. |
@@ -52,8 +55,8 @@ class PpapiDecryptor : public media::Decryptor { |
const std::string& session_id) OVERRIDE; |
virtual void CancelKeyRequest(const std::string& key_system, |
const std::string& session_id) OVERRIDE; |
- virtual void RegisterKeyAddedCB(StreamType stream_type, |
- const KeyAddedCB& key_added_cb) OVERRIDE; |
+ virtual void RegisterNewKeyCB(StreamType stream_type, |
+ const NewKeyCB& key_added_cb) OVERRIDE; |
virtual void Decrypt(StreamType stream_type, |
const scoped_refptr<media::DecoderBuffer>& encrypted, |
const DecryptCB& decrypt_cb) OVERRIDE; |
@@ -79,6 +82,21 @@ class PpapiDecryptor : public media::Decryptor { |
void OnDecoderInitialized(StreamType stream_type, bool success); |
+ // Callbacks for firing key events. |
+ void KeyAdded(const std::string& key_system, const std::string& session_id); |
+ void KeyError(const std::string& key_system, |
+ const std::string& session_id, |
+ media::Decryptor::KeyError error_code, |
+ int system_code); |
+ void KeyMessage(const std::string& key_system, |
+ const std::string& session_id, |
+ const std::string& message, |
+ const std::string& default_url); |
+ void NeedKey(const std::string& key_system, |
+ const std::string& session_id, |
+ const std::string& type, |
+ scoped_array<uint8> init_data, int init_data_size); |
+ |
media::DecryptorClient* client_; |
// Hold a reference of the plugin instance to make sure the plugin outlives |
@@ -86,14 +104,20 @@ class PpapiDecryptor : public media::Decryptor { |
// is owned by the |plugin_instance_|. |
scoped_refptr<webkit::ppapi::PluginInstance> plugin_instance_; |
+ // Callbacks for firing key events. |
+ media::KeyAddedCB key_added_cb_; |
+ media::KeyErrorCB key_error_cb_; |
+ media::KeyMessageCB key_message_cb_; |
+ media::NeedKeyCB need_key_cb_; |
+ |
webkit::ppapi::ContentDecryptorDelegate* plugin_cdm_delegate_; |
scoped_refptr<base::MessageLoopProxy> render_loop_proxy_; |
DecoderInitCB audio_decoder_init_cb_; |
DecoderInitCB video_decoder_init_cb_; |
- KeyAddedCB audio_key_added_cb_; |
- KeyAddedCB video_key_added_cb_; |
+ NewKeyCB new_audio_key_cb_; |
+ NewKeyCB new_video_key_cb_; |
base::WeakPtrFactory<PpapiDecryptor> weak_ptr_factory_; |
base::WeakPtr<PpapiDecryptor> weak_this_; |