Index: media/cdm/aes_decryptor.h |
diff --git a/media/cdm/aes_decryptor.h b/media/cdm/aes_decryptor.h |
index e2462ca7a9793919ed8031803dab15ce947505d0..a11010acfd2c2f66fcc1b5b4576099c2228391e1 100644 |
--- a/media/cdm/aes_decryptor.h |
+++ b/media/cdm/aes_decryptor.h |
@@ -16,6 +16,7 @@ |
#include "media/base/decryptor.h" |
#include "media/base/media_export.h" |
#include "media/base/media_keys.h" |
+#include "media/base/media_keys_session_promise.h" |
namespace crypto { |
class SymmetricKey; |
@@ -27,24 +28,27 @@ namespace media { |
// encryption must be CTR with a key size of 128bits. |
class MEDIA_EXPORT AesDecryptor : public MediaKeys, public Decryptor { |
public: |
- AesDecryptor(const SessionCreatedCB& session_created_cb, |
- const SessionMessageCB& session_message_cb, |
- const SessionReadyCB& session_ready_cb, |
- const SessionClosedCB& session_closed_cb, |
- const SessionErrorCB& session_error_cb); |
+ AesDecryptor(const SessionMessageCB& session_message_cb); |
virtual ~AesDecryptor(); |
// MediaKeys implementation. |
- virtual bool CreateSession(uint32 session_id, |
- const std::string& content_type, |
- const uint8* init_data, |
- int init_data_length) OVERRIDE; |
- virtual void LoadSession(uint32 session_id, |
- const std::string& web_session_id) OVERRIDE; |
- virtual void UpdateSession(uint32 session_id, |
- const uint8* response, |
- int response_length) OVERRIDE; |
- virtual void ReleaseSession(uint32 session_id) OVERRIDE; |
+ virtual void CreateSession( |
+ const std::string& init_data_type, |
+ const uint8* init_data, |
+ int init_data_length, |
+ SessionType session_type, |
+ scoped_ptr<MediaKeysSessionPromise> promise) OVERRIDE; |
+ virtual void LoadSession( |
+ const std::string& web_session_id, |
+ scoped_ptr<MediaKeysSessionPromise> promise) OVERRIDE; |
+ virtual void UpdateSession( |
+ const std::string& web_session_id, |
+ const uint8* response, |
+ int response_length, |
+ scoped_ptr<MediaKeysSessionPromise> promise) OVERRIDE; |
+ virtual void ReleaseSession( |
+ const std::string& web_session_id, |
+ scoped_ptr<MediaKeysSessionPromise> promise) OVERRIDE; |
virtual Decryptor* GetDecryptor() OVERRIDE; |
// Decryptor implementation. |
@@ -103,7 +107,7 @@ class MEDIA_EXPORT AesDecryptor : public MediaKeys, public Decryptor { |
// Creates a DecryptionKey using |key_string| and associates it with |key_id|. |
// Returns true if successful. |
- bool AddDecryptionKey(const uint32 session_id, |
+ bool AddDecryptionKey(const std::string& web_session_id, |
const std::string& key_id, |
const std::string& key_string); |
@@ -111,15 +115,11 @@ class MEDIA_EXPORT AesDecryptor : public MediaKeys, public Decryptor { |
// the key. Returns NULL if no key is associated with |key_id|. |
DecryptionKey* GetKey(const std::string& key_id) const; |
- // Deletes all keys associated with |session_id|. |
- void DeleteKeysForSession(const uint32 session_id); |
+ // Deletes all keys associated with |web_session_id|. |
+ void DeleteKeysForSession(const std::string& web_session_id); |
// Callbacks for firing session events. |
- SessionCreatedCB session_created_cb_; |
SessionMessageCB session_message_cb_; |
- SessionReadyCB session_ready_cb_; |
- SessionClosedCB session_closed_cb_; |
- SessionErrorCB session_error_cb_; |
// Since only Decrypt() is called off the renderer thread, we only need to |
// protect |key_map_|, the only member variable that is shared between |
@@ -127,8 +127,8 @@ class MEDIA_EXPORT AesDecryptor : public MediaKeys, public Decryptor { |
KeyIdToSessionKeysMap key_map_; // Protected by |key_map_lock_|. |
mutable base::Lock key_map_lock_; // Protects the |key_map_|. |
- // Keeps track of current valid session IDs. |
- std::set<uint32> valid_sessions_; |
+ // Keeps track of current valid sessions. |
+ std::set<std::string> valid_sessions_; |
// Make web session ID unique per renderer by making it static. Web session |
// IDs seen by the app will be "1", "2", etc. |