summaryrefslogtreecommitdiffstats
path: root/content/renderer
diff options
context:
space:
mode:
authorxhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-10 00:35:03 +0000
committerxhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-10 00:35:03 +0000
commit9c832e662c0ab5a9548600cf4ecdb62a3ecc2033 (patch)
treed9500ce0c49775f73df5d135ceff8896beff85ac /content/renderer
parenta7cca9b17301e51c511699ce6424a91b93ad0374 (diff)
downloadchromium_src-9c832e662c0ab5a9548600cf4ecdb62a3ecc2033.zip
chromium_src-9c832e662c0ab5a9548600cf4ecdb62a3ecc2033.tar.gz
chromium_src-9c832e662c0ab5a9548600cf4ecdb62a3ecc2033.tar.bz2
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
Diffstat (limited to 'content/renderer')
-rw-r--r--content/renderer/media/webcontentdecryptionmodulesession_impl.cc14
-rw-r--r--content/renderer/media/webcontentdecryptionmodulesession_impl.h9
2 files changed, 20 insertions, 3 deletions
diff --git a/content/renderer/media/webcontentdecryptionmodulesession_impl.cc b/content/renderer/media/webcontentdecryptionmodulesession_impl.cc
index bc74d35..93cab72 100644
--- a/content/renderer/media/webcontentdecryptionmodulesession_impl.cc
+++ b/content/renderer/media/webcontentdecryptionmodulesession_impl.cc
@@ -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
diff --git a/content/renderer/media/webcontentdecryptionmodulesession_impl.h b/content/renderer/media/webcontentdecryptionmodulesession_impl.h
index 12c4fc3..c614ee3 100644
--- a/content/renderer/media/webcontentdecryptionmodulesession_impl.h
+++ b/content/renderer/media/webcontentdecryptionmodulesession_impl.h
@@ -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.