summaryrefslogtreecommitdiffstats
path: root/media/cdm
diff options
context:
space:
mode:
Diffstat (limited to 'media/cdm')
-rw-r--r--media/cdm/default_cdm_factory.cc12
-rw-r--r--media/cdm/proxy_decryptor.cc3
-rw-r--r--media/cdm/proxy_decryptor.h3
3 files changed, 13 insertions, 5 deletions
diff --git a/media/cdm/default_cdm_factory.cc b/media/cdm/default_cdm_factory.cc
index 4132a24..6b9714a 100644
--- a/media/cdm/default_cdm_factory.cc
+++ b/media/cdm/default_cdm_factory.cc
@@ -32,9 +32,15 @@ void DefaultCdmFactory::Create(
const SessionKeysChangeCB& session_keys_change_cb,
const SessionExpirationUpdateCB& session_expiration_update_cb,
const CdmCreatedCB& cdm_created_cb) {
- if (!security_origin.is_valid() || !CanUseAesDecryptor(key_system)) {
+ if (!security_origin.is_valid()) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE, base::Bind(cdm_created_cb, nullptr));
+ FROM_HERE, base::Bind(cdm_created_cb, nullptr, "Invalid origin."));
+ return;
+ }
+ if (!CanUseAesDecryptor(key_system)) {
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE,
+ base::Bind(cdm_created_cb, nullptr, "Unsupported key system."));
return;
}
@@ -42,7 +48,7 @@ void DefaultCdmFactory::Create(
new AesDecryptor(security_origin, session_message_cb, session_closed_cb,
session_keys_change_cb));
base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE, base::Bind(cdm_created_cb, base::Passed(&cdm)));
+ FROM_HERE, base::Bind(cdm_created_cb, base::Passed(&cdm), ""));
}
} // namespace media
diff --git a/media/cdm/proxy_decryptor.cc b/media/cdm/proxy_decryptor.cc
index b8ba19c..d8dcd5a 100644
--- a/media/cdm/proxy_decryptor.cc
+++ b/media/cdm/proxy_decryptor.cc
@@ -89,7 +89,8 @@ void ProxyDecryptor::CreateCdm(CdmFactory* cdm_factory,
void ProxyDecryptor::OnCdmCreated(const std::string& key_system,
const GURL& security_origin,
const CdmContextReadyCB& cdm_context_ready_cb,
- scoped_ptr<MediaKeys> cdm) {
+ scoped_ptr<MediaKeys> cdm,
+ const std::string& /* error_message */) {
is_creating_cdm_ = false;
if (!cdm) {
diff --git a/media/cdm/proxy_decryptor.h b/media/cdm/proxy_decryptor.h
index 9a17a98..09a94e3 100644
--- a/media/cdm/proxy_decryptor.h
+++ b/media/cdm/proxy_decryptor.h
@@ -76,7 +76,8 @@ class MEDIA_EXPORT ProxyDecryptor {
void OnCdmCreated(const std::string& key_system,
const GURL& security_origin,
const CdmContextReadyCB& cdm_context_ready_cb,
- scoped_ptr<MediaKeys> cdm);
+ scoped_ptr<MediaKeys> cdm,
+ const std::string& error_message);
void GenerateKeyRequestInternal(EmeInitDataType init_data_type,
const std::vector<uint8>& init_data);