Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(581)

Unified Diff: media/cdm/default_cdm_factory.cc

Issue 2445433003: media: Enable encrypted media content browsertests when MojoCdm is used (Closed)
Patch Set: rebase only Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/key_systems.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6efa19c33195e6cbb4d674d04029af4b005eb4bc 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 ShouldCreateAesDecryptor(const std::string& key_system) {
+ if (CanUseAesDecryptor(key_system))
+ return true;
+
+ // Should create AesDecryptor to support External Clear Key key system.
+ // 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 (!ShouldCreateAesDecryptor(key_system)) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(cdm_created_cb, nullptr, "Unsupported key system."));
« no previous file with comments | « media/base/key_systems.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698