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

Unified Diff: webkit/media/crypto/ppapi_decryptor.h

Issue 11226019: Encrypted Media: Replace DecryptorClient with key event callbacks. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: add spec link Created 8 years 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 side-by-side diff with in-line comments
Download patch
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..e66dc9659402e722006ef2cae1d7ef12c826185e 100644
--- a/webkit/media/crypto/ppapi_decryptor.h
+++ b/webkit/media/crypto/ppapi_decryptor.h
@@ -16,10 +16,6 @@ namespace base {
class MessageLoopProxy;
}
-namespace media {
-class DecryptorClient;
-}
-
namespace webkit {
namespace ppapi {
class ContentDecryptorDelegate;
@@ -35,8 +31,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 +51,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,21 +78,40 @@ class PpapiDecryptor : public media::Decryptor {
void OnDecoderInitialized(StreamType stream_type, bool success);
- media::DecryptorClient* client_;
+ // Callbacks for firing key events.
ddorwin 2012/12/21 04:19:06 Should we mention who calls these?
xhwang 2012/12/21 05:50:07 Done.
+ 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);
// Hold a reference of the plugin instance to make sure the plugin outlives
// the |plugin_cdm_delegate_|. This is needed because |plugin_cdm_delegate_|
// 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_;

Powered by Google App Engine
This is Rietveld 408576698