Commit 9c832e66 authored by xhwang@chromium.org's avatar xhwang@chromium.org

Update WebContentDecryptionModuleSessionImpl to the latest EME spec.

- generateKeyRequest() -> initializeNewSession()
- close() -> release()

This change is made to match the latest EME spec. The deprecated methods
will be dropped after Blink is updated. The Blink side change is at:
https://codereview.chromium.org/111043004/

BUG=224786

Review URL: https://codereview.chromium.org/101693009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244029 0039d316-1c4b-4281-b951-d872f2087c98
parent a7cca9b1
...@@ -31,7 +31,7 @@ blink::WebString WebContentDecryptionModuleSessionImpl::sessionId() const { ...@@ -31,7 +31,7 @@ blink::WebString WebContentDecryptionModuleSessionImpl::sessionId() const {
return web_session_id_; return web_session_id_;
} }
void WebContentDecryptionModuleSessionImpl::generateKeyRequest( void WebContentDecryptionModuleSessionImpl::initializeNewSession(
const blink::WebString& mime_type, const blink::WebString& mime_type,
const uint8* init_data, size_t init_data_length) { const uint8* init_data, size_t init_data_length) {
// TODO(ddorwin): Guard against this in supported types check and remove this. // TODO(ddorwin): Guard against this in supported types check and remove this.
...@@ -46,16 +46,26 @@ void WebContentDecryptionModuleSessionImpl::generateKeyRequest( ...@@ -46,16 +46,26 @@ void WebContentDecryptionModuleSessionImpl::generateKeyRequest(
session_id_, UTF16ToASCII(mime_type), init_data, init_data_length); session_id_, UTF16ToASCII(mime_type), init_data, init_data_length);
} }
void WebContentDecryptionModuleSessionImpl::generateKeyRequest(
const blink::WebString& mime_type,
const uint8* init_data, size_t init_data_length) {
initializeNewSession(mime_type, init_data, init_data_length);
}
void WebContentDecryptionModuleSessionImpl::update(const uint8* response, void WebContentDecryptionModuleSessionImpl::update(const uint8* response,
size_t response_length) { size_t response_length) {
DCHECK(response); DCHECK(response);
media_keys_->UpdateSession(session_id_, response, response_length); media_keys_->UpdateSession(session_id_, response, response_length);
} }
void WebContentDecryptionModuleSessionImpl::close() { void WebContentDecryptionModuleSessionImpl::release() {
media_keys_->ReleaseSession(session_id_); media_keys_->ReleaseSession(session_id_);
} }
void WebContentDecryptionModuleSessionImpl::close() {
release();
}
void WebContentDecryptionModuleSessionImpl::OnSessionCreated( void WebContentDecryptionModuleSessionImpl::OnSessionCreated(
const std::string& web_session_id) { const std::string& web_session_id) {
// Due to heartbeat messages, OnSessionCreated() can get called multiple // Due to heartbeat messages, OnSessionCreated() can get called multiple
......
...@@ -34,10 +34,17 @@ class WebContentDecryptionModuleSessionImpl ...@@ -34,10 +34,17 @@ class WebContentDecryptionModuleSessionImpl
// blink::WebContentDecryptionModuleSession implementation. // blink::WebContentDecryptionModuleSession implementation.
virtual blink::WebString sessionId() const; virtual blink::WebString sessionId() const;
virtual void initializeNewSession(const blink::WebString& mime_type,
const uint8* init_data,
size_t init_data_length);
virtual void update(const uint8* response, size_t response_length);
virtual void release();
// TODO(xhwang): Drop generateKeyRequest() and close() after blink side is
// updated.
virtual void generateKeyRequest(const blink::WebString& mime_type, virtual void generateKeyRequest(const blink::WebString& mime_type,
const uint8* init_data, const uint8* init_data,
size_t init_data_length); size_t init_data_length);
virtual void update(const uint8* response, size_t response_length);
virtual void close(); virtual void close();
// Callbacks. // Callbacks.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment