diff options
author | Torne (Richard Coles) <torne@google.com> | 2013-12-18 16:25:09 +0000 |
---|---|---|
committer | Torne (Richard Coles) <torne@google.com> | 2013-12-18 16:25:09 +0000 |
commit | a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7 (patch) | |
tree | dafc1c6417406a7fbd422ad0bb890e96909ef564 /media/base/media_keys.h | |
parent | d5f893c0bc79db3066bb5ae5d3d972ba1be7dd5f (diff) | |
download | chromium_org-a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7.tar.gz |
Merge from Chromium at DEPS revision 240154
This commit was generated by merge_to_master.py.
Change-Id: I8f2ba858cf0e7f413dddedc2ae91dc37f7136c2e
Diffstat (limited to 'media/base/media_keys.h')
-rw-r--r-- | media/base/media_keys.h | 64 |
1 files changed, 31 insertions, 33 deletions
diff --git a/media/base/media_keys.h b/media/base/media_keys.h index 743d71459b..0d86948564 100644 --- a/media/base/media_keys.h +++ b/media/base/media_keys.h @@ -37,32 +37,28 @@ class MEDIA_EXPORT MediaKeys { kMaxKeyError // Must be last and greater than any legit value. }; - const static uint32 kInvalidReferenceId = 0; + const static uint32 kInvalidSessionId = 0; MediaKeys(); virtual ~MediaKeys(); // Generates a key request with the |type| and |init_data| provided. // Returns true if generating key request succeeded, false otherwise. - // Note: AddKey() and CancelKeyRequest() should only be called after - // GenerateKeyRequest() returns true. - virtual bool GenerateKeyRequest(uint32 reference_id, - const std::string& type, - const uint8* init_data, - int init_data_length) = 0; - - // Adds a |key| to the session. The |key| is not limited to a decryption - // key. It can be any data that the key system accepts, such as a license. - // If multiple calls of this function set different keys for the same - // key ID, the older key will be replaced by the newer key. - virtual void AddKey(uint32 reference_id, - const uint8* key, - int key_length, - const uint8* init_data, - int init_data_length) = 0; - - // Cancels the key request specified by |reference_id|. - virtual void CancelKeyRequest(uint32 reference_id) = 0; + // Note: UpdateSession() and ReleaseSession() should only be called after + // CreateSession() returns true. + // TODO(jrummell): Remove return value when prefixed API is removed. + virtual bool CreateSession(uint32 session_id, + const std::string& type, + const uint8* init_data, + int init_data_length) = 0; + + // Updates a session specified by |session_id| with |response|. + virtual void UpdateSession(uint32 session_id, + const uint8* response, + int response_length) = 0; + + // Releases the session specified by |session_id|. + virtual void ReleaseSession(uint32 session_id) = 0; // Gets the Decryptor object associated with the MediaKeys. Returns NULL if // no Decryptor object is associated. The returned object is only guaranteed @@ -74,22 +70,24 @@ class MEDIA_EXPORT MediaKeys { }; // Key event callbacks. See the spec for details: -// http://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1b/encrypted-media/encrypted-media.html#event-summary -typedef base::Callback<void(uint32 reference_id)> KeyAddedCB; +// https://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/encrypted-media.html#event-summary +typedef base::Callback< + void(uint32 session_id, const std::string& web_session_id)> + SessionCreatedCB; -typedef base::Callback<void(uint32 reference_id, - media::MediaKeys::KeyError error_code, - int system_code)> KeyErrorCB; - -typedef base::Callback<void(uint32 reference_id, +typedef base::Callback<void(uint32 session_id, const std::vector<uint8>& message, - const std::string& default_url)> KeyMessageCB; + const std::string& destination_url)> + SessionMessageCB; + +typedef base::Callback<void(uint32 session_id)> SessionReadyCB; + +typedef base::Callback<void(uint32 session_id)> SessionClosedCB; + +typedef base::Callback<void(uint32 session_id, + media::MediaKeys::KeyError error_code, + int system_code)> SessionErrorCB; -// Called by the CDM when it generates the |session_id| as a result of a -// GenerateKeyRequest() call. Must be called before KeyMessageCB or KeyAddedCB -// events are fired. -typedef base::Callback<void(uint32 reference_id, - const std::string& session_id)> SetSessionIdCB; } // namespace media #endif // MEDIA_BASE_MEDIA_KEYS_H_ |