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

Unified Diff: media/cdm/aes_decryptor.h

Issue 265993002: Add Promises for EME (Chromium side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: One more trybot issue Created 6 years, 6 months 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
« no previous file with comments | « media/base/media_keys.h ('k') | media/cdm/aes_decryptor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cdm/aes_decryptor.h
diff --git a/media/cdm/aes_decryptor.h b/media/cdm/aes_decryptor.h
index e2462ca7a9793919ed8031803dab15ce947505d0..ab7c980e4ef2c75f3f850bcfa93ff3794b7102e2 100644
--- a/media/cdm/aes_decryptor.h
+++ b/media/cdm/aes_decryptor.h
@@ -27,24 +27,23 @@ 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);
+ explicit AesDecryptor(const SessionMessageCB& session_message_cb);
virtual ~AesDecryptor();
// MediaKeys implementation.
- virtual bool CreateSession(uint32 session_id,
- const std::string& content_type,
+ virtual void CreateSession(const std::string& init_data_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,
+ int init_data_length,
+ SessionType session_type,
+ scoped_ptr<NewSessionCdmPromise> promise) OVERRIDE;
+ virtual void LoadSession(const std::string& web_session_id,
+ scoped_ptr<NewSessionCdmPromise> promise) OVERRIDE;
+ virtual void UpdateSession(const std::string& web_session_id,
const uint8* response,
- int response_length) OVERRIDE;
- virtual void ReleaseSession(uint32 session_id) OVERRIDE;
+ int response_length,
+ scoped_ptr<SimpleCdmPromise> promise) OVERRIDE;
+ virtual void ReleaseSession(const std::string& web_session_id,
+ scoped_ptr<SimpleCdmPromise> promise) OVERRIDE;
virtual Decryptor* GetDecryptor() OVERRIDE;
// Decryptor implementation.
@@ -103,7 +102,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 +110,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 +122,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.
« no previous file with comments | « media/base/media_keys.h ('k') | media/cdm/aes_decryptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698