diff options
author | jrummell <jrummell@chromium.org> | 2014-09-25 17:10:38 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-26 00:10:48 +0000 |
commit | 80428d2eb359a2448c67ae45ece3ea5dbc2f8cef (patch) | |
tree | 8336dc22e94a678c64611314f66f7dee6488ab34 /content/renderer/media/webcontentdecryptionmodule_impl.cc | |
parent | 422b434274e09a95ca778dd29890d51ab2c15ae5 (diff) | |
download | chromium_src-80428d2eb359a2448c67ae45ece3ea5dbc2f8cef.zip chromium_src-80428d2eb359a2448c67ae45ece3ea5dbc2f8cef.tar.gz chromium_src-80428d2eb359a2448c67ae45ece3ea5dbc2f8cef.tar.bz2 |
Update MediaKeys interface for EME
To support CDM_6, make the following changes:
- add SetServerCertificate
- add GetUsableKeyIds
- rename ReleaseSession to CloseSession
- add RemoveSession
- add SessionKeysChange event
- add SessionExpirationChange event
This gets the new functionality up to the blink boundary. Changes to
use these new interfaces in blink in a future CL.
For backwards compatibility with existing prefixed EME code, calls
to CancelKeyRequest() call RemoveSession() instead of CloseSession().
BUG=358271,417481
TEST=existing EME tests still pass + manual testing
Review URL: https://codereview.chromium.org/555223004
Cr-Commit-Position: refs/heads/master@{#296838}
Diffstat (limited to 'content/renderer/media/webcontentdecryptionmodule_impl.cc')
-rw-r--r-- | content/renderer/media/webcontentdecryptionmodule_impl.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/content/renderer/media/webcontentdecryptionmodule_impl.cc b/content/renderer/media/webcontentdecryptionmodule_impl.cc index 9dcb39e..60b2d04 100644 --- a/content/renderer/media/webcontentdecryptionmodule_impl.cc +++ b/content/renderer/media/webcontentdecryptionmodule_impl.cc @@ -12,9 +12,11 @@ #include "base/logging.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" +#include "content/renderer/media/cdm_result_promise.h" #include "content/renderer/media/cdm_session_adapter.h" #include "content/renderer/media/crypto/key_systems.h" #include "content/renderer/media/webcontentdecryptionmodulesession_impl.h" +#include "media/base/cdm_promise.h" #include "media/base/media_keys.h" #include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/web/WebSecurityOrigin.h" @@ -78,7 +80,8 @@ WebContentDecryptionModuleImpl* WebContentDecryptionModuleImpl::Create( WebContentDecryptionModuleImpl::WebContentDecryptionModuleImpl( scoped_refptr<CdmSessionAdapter> adapter) - : adapter_(adapter) {} + : adapter_(adapter) { +} WebContentDecryptionModuleImpl::~WebContentDecryptionModuleImpl() { } @@ -97,6 +100,17 @@ WebContentDecryptionModuleImpl::createSession( return session; } +void WebContentDecryptionModuleImpl::setServerCertificate( + const uint8* server_certificate, + size_t server_certificate_length, + blink::WebContentDecryptionModuleResult result) { + DCHECK(server_certificate); + adapter_->SetServerCertificate( + server_certificate, + server_certificate_length, + scoped_ptr<media::SimpleCdmPromise>(new SimpleCdmResultPromise(result))); +} + media::Decryptor* WebContentDecryptionModuleImpl::GetDecryptor() { return adapter_->GetDecryptor(); } |