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 {
return web_session_id_;
}
void WebContentDecryptionModuleSessionImpl::generateKeyRequest(
void WebContentDecryptionModuleSessionImpl::initializeNewSession(
const blink::WebString& mime_type,
const uint8* init_data, size_t init_data_length) {
// TODO(ddorwin): Guard against this in supported types check and remove this.
......@@ -46,16 +46,26 @@ void WebContentDecryptionModuleSessionImpl::generateKeyRequest(
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,
size_t response_length) {
DCHECK(response);
media_keys_->UpdateSession(session_id_, response, response_length);
}
void WebContentDecryptionModuleSessionImpl::close() {
void WebContentDecryptionModuleSessionImpl::release() {
media_keys_->ReleaseSession(session_id_);
}
void WebContentDecryptionModuleSessionImpl::close() {
release();
}
void WebContentDecryptionModuleSessionImpl::OnSessionCreated(
const std::string& web_session_id) {
// Due to heartbeat messages, OnSessionCreated() can get called multiple
......
......@@ -34,10 +34,17 @@ class WebContentDecryptionModuleSessionImpl
// blink::WebContentDecryptionModuleSession implementation.
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,
const uint8* init_data,
size_t init_data_length);
virtual void update(const uint8* response, size_t response_length);
virtual void close();
// 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