| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/renderer/media/chrome_key_systems.h" | 5 #include "chrome/renderer/media/chrome_key_systems.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 static void AddExternalClearKey( | 63 static void AddExternalClearKey( |
| 64 std::vector<KeySystemInfo>* concrete_key_systems) { | 64 std::vector<KeySystemInfo>* concrete_key_systems) { |
| 65 static const char kExternalClearKeyKeySystem[] = | 65 static const char kExternalClearKeyKeySystem[] = |
| 66 "org.chromium.externalclearkey"; | 66 "org.chromium.externalclearkey"; |
| 67 static const char kExternalClearKeyDecryptOnlyKeySystem[] = | 67 static const char kExternalClearKeyDecryptOnlyKeySystem[] = |
| 68 "org.chromium.externalclearkey.decryptonly"; | 68 "org.chromium.externalclearkey.decryptonly"; |
| 69 static const char kExternalClearKeyFileIOTestKeySystem[] = | 69 static const char kExternalClearKeyFileIOTestKeySystem[] = |
| 70 "org.chromium.externalclearkey.fileiotest"; | 70 "org.chromium.externalclearkey.fileiotest"; |
| 71 static const char kExternalClearKeyInitializeFailKeySystem[] = | 71 static const char kExternalClearKeyInitializeFailKeySystem[] = |
| 72 "org.chromium.externalclearkey.initializefail"; | 72 "org.chromium.externalclearkey.initializefail"; |
| 73 static const char kExternalClearKeyCrashKeySystem[] = |
| 74 "org.chromium.externalclearkey.crash"; |
| 73 static const char kExternalClearKeyPepperType[] = | 75 static const char kExternalClearKeyPepperType[] = |
| 74 "application/x-ppapi-clearkey-cdm"; | 76 "application/x-ppapi-clearkey-cdm"; |
| 75 | 77 |
| 76 std::vector<base::string16> additional_param_names; | 78 std::vector<base::string16> additional_param_names; |
| 77 std::vector<base::string16> additional_param_values; | 79 std::vector<base::string16> additional_param_values; |
| 78 if (!IsPepperCdmRegistered(kExternalClearKeyPepperType, | 80 if (!IsPepperCdmRegistered(kExternalClearKeyPepperType, |
| 79 &additional_param_names, | 81 &additional_param_names, |
| 80 &additional_param_values)) { | 82 &additional_param_values)) { |
| 81 return; | 83 return; |
| 82 } | 84 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 99 | 101 |
| 100 // A key system that triggers FileIO test in ClearKeyCdm. | 102 // A key system that triggers FileIO test in ClearKeyCdm. |
| 101 info.key_system = kExternalClearKeyFileIOTestKeySystem; | 103 info.key_system = kExternalClearKeyFileIOTestKeySystem; |
| 102 concrete_key_systems->push_back(info); | 104 concrete_key_systems->push_back(info); |
| 103 | 105 |
| 104 // A key system that Chrome thinks is supported by ClearKeyCdm, but actually | 106 // A key system that Chrome thinks is supported by ClearKeyCdm, but actually |
| 105 // will be refused by ClearKeyCdm. This is to test the CDM initialization | 107 // will be refused by ClearKeyCdm. This is to test the CDM initialization |
| 106 // failure case. | 108 // failure case. |
| 107 info.key_system = kExternalClearKeyInitializeFailKeySystem; | 109 info.key_system = kExternalClearKeyInitializeFailKeySystem; |
| 108 concrete_key_systems->push_back(info); | 110 concrete_key_systems->push_back(info); |
| 111 |
| 112 // A key system that triggers a crash in ClearKeyCdm. |
| 113 info.key_system = kExternalClearKeyCrashKeySystem; |
| 114 concrete_key_systems->push_back(info); |
| 109 } | 115 } |
| 110 #endif // defined(ENABLE_PEPPER_CDMS) | 116 #endif // defined(ENABLE_PEPPER_CDMS) |
| 111 | 117 |
| 112 | 118 |
| 113 #if defined(WIDEVINE_CDM_AVAILABLE) | 119 #if defined(WIDEVINE_CDM_AVAILABLE) |
| 114 enum WidevineCdmType { | 120 enum WidevineCdmType { |
| 115 WIDEVINE, | 121 WIDEVINE, |
| 116 WIDEVINE_HR, | 122 WIDEVINE_HR, |
| 117 #if defined(OS_ANDROID) | 123 #if defined(OS_ANDROID) |
| 118 WIDEVINE_HR_NON_COMPOSITING, | 124 WIDEVINE_HR_NON_COMPOSITING, |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 #endif | 330 #endif |
| 325 | 331 |
| 326 #if defined(WIDEVINE_CDM_AVAILABLE) | 332 #if defined(WIDEVINE_CDM_AVAILABLE) |
| 327 #if defined(ENABLE_PEPPER_CDMS) | 333 #if defined(ENABLE_PEPPER_CDMS) |
| 328 AddPepperBasedWidevine(key_systems_info); | 334 AddPepperBasedWidevine(key_systems_info); |
| 329 #elif defined(OS_ANDROID) | 335 #elif defined(OS_ANDROID) |
| 330 AddAndroidWidevine(key_systems_info); | 336 AddAndroidWidevine(key_systems_info); |
| 331 #endif | 337 #endif |
| 332 #endif | 338 #endif |
| 333 } | 339 } |
| OLD | NEW |