Chromium Code Reviews| Index: media/cdm/default_cdm_factory.cc |
| diff --git a/media/cdm/default_cdm_factory.cc b/media/cdm/default_cdm_factory.cc |
| index ab65df65815ea2c1ba114ab22f26c879faa8b5bc..f1da8b19fdc824e5ed027db6be83802082f8c096 100644 |
| --- a/media/cdm/default_cdm_factory.cc |
| +++ b/media/cdm/default_cdm_factory.cc |
| @@ -9,7 +9,9 @@ |
| #include "base/location.h" |
| #include "base/single_thread_task_runner.h" |
| #include "base/threading/thread_task_runner_handle.h" |
| +#include "media/base/key_system_names.h" |
| #include "media/base/key_systems.h" |
| +#include "media/base/media_switches.h" |
| #include "media/cdm/aes_decryptor.h" |
| #include "url/gurl.h" |
| @@ -21,6 +23,16 @@ DefaultCdmFactory::DefaultCdmFactory() { |
| DefaultCdmFactory::~DefaultCdmFactory() { |
| } |
| +static bool ShouldUseAesDecryptor(const std::string& key_system) { |
|
ddorwin
2016/10/28 19:03:47
s/Use/Create/?
xhwang
2016/11/03 07:14:44
Done.
|
| + if (CanUseAesDecryptor(key_system)) |
| + return true; |
| + |
| + // Create AesDecryptor here to support External Clear Key key system. |
|
ddorwin
2016/10/28 19:03:48
nit: This comment is a bit odd ("Create... here").
xhwang
2016/11/03 07:14:44
Done.
|
| + // This is used for testing. |
| + return base::FeatureList::IsEnabled(media::kExternalClearKeyForTesting) && |
| + IsExternalClearKey(key_system); |
| +} |
| + |
| void DefaultCdmFactory::Create( |
| const std::string& key_system, |
| const GURL& security_origin, |
| @@ -35,7 +47,8 @@ void DefaultCdmFactory::Create( |
| FROM_HERE, base::Bind(cdm_created_cb, nullptr, "Invalid origin.")); |
| return; |
| } |
| - if (!CanUseAesDecryptor(key_system)) { |
| + |
| + if (!ShouldUseAesDecryptor(key_system)) { |
| base::ThreadTaskRunnerHandle::Get()->PostTask( |
| FROM_HERE, |
| base::Bind(cdm_created_cb, nullptr, "Unsupported key system.")); |