Change blimp README to use Markdown.
[chromium-blink-merge.git] / media / cdm / key_system_names.cc
blob1782203ae5fec656126063de932dc8c3d364c5e0
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "media/cdm/key_system_names.h"
8 namespace media {
10 const char kClearKey[] = "org.w3.clearkey";
11 const char kExternalClearKey[] = "org.chromium.externalclearkey";
13 bool IsClearKey(const std::string& key_system) {
14 return key_system == kClearKey;
17 bool IsParentKeySystemOf(const std::string& parent_key_system,
18 const std::string& key_system) {
19 std::string prefix = parent_key_system + '.';
20 return key_system.substr(0, prefix.size()) == prefix;
23 bool IsExternalClearKey(const std::string& key_system) {
24 return key_system == kExternalClearKey ||
25 IsParentKeySystemOf(kExternalClearKey, key_system);
28 } // namespace media