| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 const std::string key_system_name_; | 125 const std::string key_system_name_; |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 // External Clear Key (used for testing). | 128 // External Clear Key (used for testing). |
| 129 static void AddExternalClearKey( | 129 static void AddExternalClearKey( |
| 130 std::vector<std::unique_ptr<KeySystemProperties>>* concrete_key_systems) { | 130 std::vector<std::unique_ptr<KeySystemProperties>>* concrete_key_systems) { |
| 131 static const char kExternalClearKeyKeySystem[] = | 131 static const char kExternalClearKeyKeySystem[] = |
| 132 "org.chromium.externalclearkey"; | 132 "org.chromium.externalclearkey"; |
| 133 static const char kExternalClearKeyDecryptOnlyKeySystem[] = | 133 static const char kExternalClearKeyDecryptOnlyKeySystem[] = |
| 134 "org.chromium.externalclearkey.decryptonly"; | 134 "org.chromium.externalclearkey.decryptonly"; |
| 135 static const char kExternalClearKeyRenewalKeySystem[] = |
| 136 "org.chromium.externalclearkey.renewal"; |
| 135 static const char kExternalClearKeyFileIOTestKeySystem[] = | 137 static const char kExternalClearKeyFileIOTestKeySystem[] = |
| 136 "org.chromium.externalclearkey.fileiotest"; | 138 "org.chromium.externalclearkey.fileiotest"; |
| 137 static const char kExternalClearKeyOutputProtectionTestKeySystem[] = | 139 static const char kExternalClearKeyOutputProtectionTestKeySystem[] = |
| 138 "org.chromium.externalclearkey.outputprotectiontest"; | 140 "org.chromium.externalclearkey.outputprotectiontest"; |
| 139 static const char kExternalClearKeyInitializeFailKeySystem[] = | 141 static const char kExternalClearKeyInitializeFailKeySystem[] = |
| 140 "org.chromium.externalclearkey.initializefail"; | 142 "org.chromium.externalclearkey.initializefail"; |
| 141 static const char kExternalClearKeyCrashKeySystem[] = | 143 static const char kExternalClearKeyCrashKeySystem[] = |
| 142 "org.chromium.externalclearkey.crash"; | 144 "org.chromium.externalclearkey.crash"; |
| 143 | 145 |
| 144 std::vector<base::string16> additional_param_names; | 146 std::vector<base::string16> additional_param_names; |
| 145 std::vector<base::string16> additional_param_values; | 147 std::vector<base::string16> additional_param_values; |
| 146 if (!IsPepperCdmAvailable(kExternalClearKeyPepperType, | 148 if (!IsPepperCdmAvailable(kExternalClearKeyPepperType, |
| 147 &additional_param_names, | 149 &additional_param_names, |
| 148 &additional_param_values)) { | 150 &additional_param_values)) { |
| 149 return; | 151 return; |
| 150 } | 152 } |
| 151 | 153 |
| 152 concrete_key_systems->emplace_back( | 154 concrete_key_systems->emplace_back( |
| 153 new ExternalClearKeyProperties(kExternalClearKeyKeySystem)); | 155 new ExternalClearKeyProperties(kExternalClearKeyKeySystem)); |
| 154 | 156 |
| 155 // Add support of decrypt-only mode in ClearKeyCdm. | 157 // Add support of decrypt-only mode in ClearKeyCdm. |
| 156 concrete_key_systems->emplace_back( | 158 concrete_key_systems->emplace_back( |
| 157 new ExternalClearKeyProperties(kExternalClearKeyDecryptOnlyKeySystem)); | 159 new ExternalClearKeyProperties(kExternalClearKeyDecryptOnlyKeySystem)); |
| 158 | 160 |
| 161 // A key system that triggers renewal message in ClearKeyCdm. |
| 162 concrete_key_systems->emplace_back( |
| 163 new ExternalClearKeyProperties(kExternalClearKeyRenewalKeySystem)); |
| 164 |
| 159 // A key system that triggers the FileIO test in ClearKeyCdm. | 165 // A key system that triggers the FileIO test in ClearKeyCdm. |
| 160 concrete_key_systems->emplace_back( | 166 concrete_key_systems->emplace_back( |
| 161 new ExternalClearKeyProperties(kExternalClearKeyFileIOTestKeySystem)); | 167 new ExternalClearKeyProperties(kExternalClearKeyFileIOTestKeySystem)); |
| 162 | 168 |
| 163 // A key system that triggers the output protection test in ClearKeyCdm. | 169 // A key system that triggers the output protection test in ClearKeyCdm. |
| 164 concrete_key_systems->emplace_back(new ExternalClearKeyProperties( | 170 concrete_key_systems->emplace_back(new ExternalClearKeyProperties( |
| 165 kExternalClearKeyOutputProtectionTestKeySystem)); | 171 kExternalClearKeyOutputProtectionTestKeySystem)); |
| 166 | 172 |
| 167 // A key system that Chrome thinks is supported by ClearKeyCdm, but actually | 173 // A key system that Chrome thinks is supported by ClearKeyCdm, but actually |
| 168 // will be refused by ClearKeyCdm. This is to test the CDM initialization | 174 // will be refused by ClearKeyCdm. This is to test the CDM initialization |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 #if defined(WIDEVINE_CDM_AVAILABLE) | 290 #if defined(WIDEVINE_CDM_AVAILABLE) |
| 285 AddPepperBasedWidevine(key_systems_properties); | 291 AddPepperBasedWidevine(key_systems_properties); |
| 286 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 292 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
| 287 | 293 |
| 288 #endif // defined(ENABLE_PEPPER_CDMS) | 294 #endif // defined(ENABLE_PEPPER_CDMS) |
| 289 | 295 |
| 290 #if defined(OS_ANDROID) | 296 #if defined(OS_ANDROID) |
| 291 cdm::AddAndroidWidevine(key_systems_properties); | 297 cdm::AddAndroidWidevine(key_systems_properties); |
| 292 #endif // defined(OS_ANDROID) | 298 #endif // defined(OS_ANDROID) |
| 293 } | 299 } |
| OLD | NEW |