Index: media/base/decryptor.h |
diff --git a/media/base/decryptor.h b/media/base/decryptor.h |
index fd51c96f7fb623ccaf72d46e2ef952ae496547ec..b310124eb7287498445daccd6c299df57dfebcdf 100644 |
--- a/media/base/decryptor.h |
+++ b/media/base/decryptor.h |
@@ -90,16 +90,16 @@ class MEDIA_EXPORT Decryptor { |
virtual void CancelKeyRequest(const std::string& key_system, |
const std::string& session_id) = 0; |
- // Indicates that a key has been added to the Decryptor. |
- typedef base::Callback<void()> KeyAddedCB; |
+ // Indicates that a new key has been added to the Decryptor. |
ddorwin
2012/12/21 04:19:06
Is it really "new"? It could be called when we get
xhwang
2012/12/21 05:50:07
I added "new" here only to make is consistent with
|
+ typedef base::Callback<void()> NewKeyCB; |
ddorwin
2012/12/21 04:19:06
Should CB's have verb names? (I realize the ones f
xhwang
2012/12/21 05:50:07
At least this is not a rule in media code. We hace
|
- // Registers a KeyAddedCB which should be called when a key is added to the |
- // decryptor. Only one KeyAddedCB can be registered for one |stream_type|. |
+ // Registers a NewKeyCB which should be called when a new key is added to the |
+ // decryptor. Only one NewKeyCB can be registered for one |stream_type|. |
// If this function is called multiple times for the same |stream_type|, the |
// previously registered callback will be replaced. In other words, |
// registering a null callback cancels the originally registered callback. |
- virtual void RegisterKeyAddedCB(StreamType stream_type, |
- const KeyAddedCB& key_added_cb) = 0; |
+ virtual void RegisterNewKeyCB(StreamType stream_type, |
+ const NewKeyCB& key_added_cb) = 0; |
// Indicates completion of a decryption operation. |
// |
@@ -216,6 +216,28 @@ typedef base::Callback<void(Decryptor*)> DecryptorReadyCB; |
// fired immediately with NULL. |
typedef base::Callback<void(const DecryptorReadyCB&)> SetDecryptorReadyCB; |
+ |
+// Key event callbacks. See the spec for details: |
+// http://dvcs.w3.org/hg/html-media/raw-file/tip/encrypted-media/encrypted-media.html#event-summary |
ddorwin
2012/12/21 04:19:06
s/tip/eme-v0.1b/. These don't exist (in the same f
xhwang
2012/12/21 05:50:07
Done.
|
+typedef base::Callback<void(const std::string& key_system, |
+ const std::string& session_id)> KeyAddedCB; |
+ |
+typedef base::Callback<void(const std::string& key_system, |
+ const std::string& session_id, |
+ media::Decryptor::KeyError error_code, |
+ int system_code)> KeyErrorCB; |
+ |
+typedef base::Callback<void(const std::string& key_system, |
+ const std::string& session_id, |
+ const std::string& message, |
+ const std::string& default_url)> KeyMessageCB; |
+ |
+typedef base::Callback<void(const std::string& key_system, |
+ const std::string& session_id, |
+ const std::string& type, |
+ scoped_array<uint8> init_data, |
ddorwin
2012/12/21 04:19:06
Odd that message is a string but init_data isn't.
xhwang
2012/12/21 05:50:07
Agreed. I talked to dmichael the other day. We all
|
+ int init_data_size)> NeedKeyCB; |
+ |
} // namespace media |
#endif // MEDIA_BASE_DECRYPTOR_H_ |