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

Unified Diff: media/cdm/key_system_names.cc

Issue 79903002: Add decrypt-only external clear key browser tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments addressed Created 7 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/cdm/key_system_names.h ('k') | media/cdm/ppapi/clear_key_cdm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cdm/key_system_names.cc
diff --git a/media/cdm/key_system_names.cc b/media/cdm/key_system_names.cc
index 97cc9e87a4e0b9e1900edc51282ea2a13ff86cd3..b9eceb2f4db139b1b47673b2a2e8c90df0b1a55d 100644
--- a/media/cdm/key_system_names.cc
+++ b/media/cdm/key_system_names.cc
@@ -4,10 +4,24 @@
#include "media/cdm/key_system_names.h"
+#include <string>
+
namespace media {
const char kPrefixedClearKey[] = "webkit-org.w3.clearkey";
const char kUnprefixedClearKey[] = "org.w3.clearkey";
const char kExternalClearKey[] = "org.chromium.externalclearkey";
+static bool IsParentKeySystemOf(const std::string& parent_key_system,
+ const std::string& key_system) {
+ std::string prefix = parent_key_system + '.';
+ return key_system.substr(0, prefix.size()) == prefix;
+}
+
+
+bool IsExternalClearKey(const std::string& key_system) {
+ return key_system == kExternalClearKey ||
+ IsParentKeySystemOf(kExternalClearKey, key_system);
+}
+
} // namespace media
« no previous file with comments | « media/cdm/key_system_names.h ('k') | media/cdm/ppapi/clear_key_cdm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698