Chromium Code Reviews| 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 "media/base/key_systems.h" | 5 #include "media/base/key_systems.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 403 if (properties->GetDistinctiveIdentifierSupport() == | 403 if (properties->GetDistinctiveIdentifierSupport() == |
| 404 EmeFeatureSupport::NOT_SUPPORTED) { | 404 EmeFeatureSupport::NOT_SUPPORTED) { |
| 405 DCHECK(properties->GetPersistentLicenseSessionSupport() != | 405 DCHECK(properties->GetPersistentLicenseSessionSupport() != |
| 406 EmeSessionTypeSupport::SUPPORTED_WITH_IDENTIFIER); | 406 EmeSessionTypeSupport::SUPPORTED_WITH_IDENTIFIER); |
| 407 DCHECK(properties->GetPersistentReleaseMessageSessionSupport() != | 407 DCHECK(properties->GetPersistentReleaseMessageSessionSupport() != |
| 408 EmeSessionTypeSupport::SUPPORTED_WITH_IDENTIFIER); | 408 EmeSessionTypeSupport::SUPPORTED_WITH_IDENTIFIER); |
| 409 } | 409 } |
| 410 | 410 |
| 411 // Distinctive identifiers and persistent state can only be reliably blocked | 411 // Distinctive identifiers and persistent state can only be reliably blocked |
| 412 // (and therefore be safely configurable) for Pepper-hosted key systems. For | 412 // (and therefore be safely configurable) for Pepper-hosted key systems. For |
| 413 // other platforms, (except for the AES decryptor) assume that the CDM can | 413 // other platforms, (except for the AES decryptor and External Clear Key |
| 414 // key system on Android, only enabled for testing) assume that the CDM can | |
|
ddorwin
2016/09/16 19:40:07
nit: It's not clear exactly what is only enabled f
xhwang
2016/09/16 20:02:16
Done.
| |
| 414 // and will do anything. | 415 // and will do anything. |
| 415 bool can_block = properties->UseAesDecryptor(); | 416 bool can_block = properties->UseAesDecryptor(); |
| 416 #if defined(ENABLE_PEPPER_CDMS) | 417 #if defined(ENABLE_PEPPER_CDMS) |
| 417 DCHECK_EQ(properties->UseAesDecryptor(), | 418 DCHECK_EQ(properties->UseAesDecryptor(), |
| 418 properties->GetPepperType().empty()); | 419 properties->GetPepperType().empty()); |
| 419 if (!properties->GetPepperType().empty()) | 420 if (!properties->GetPepperType().empty()) |
| 420 can_block = true; | 421 can_block = true; |
| 422 #elif defined(OS_ANDROID) | |
| 423 if (IsExternalClearKey(properties->GetKeySystemName())) | |
| 424 can_block = true; | |
| 421 #endif | 425 #endif |
| 422 if (!can_block) { | 426 if (!can_block) { |
| 423 DCHECK(properties->GetDistinctiveIdentifierSupport() == | 427 DCHECK(properties->GetDistinctiveIdentifierSupport() == |
| 424 EmeFeatureSupport::ALWAYS_ENABLED); | 428 EmeFeatureSupport::ALWAYS_ENABLED); |
| 425 DCHECK(properties->GetPersistentStateSupport() == | 429 DCHECK(properties->GetPersistentStateSupport() == |
| 426 EmeFeatureSupport::ALWAYS_ENABLED); | 430 EmeFeatureSupport::ALWAYS_ENABLED); |
| 427 } | 431 } |
| 428 | 432 |
| 429 DCHECK_EQ(key_system_properties_map_.count(properties->GetKeySystemName()), | 433 DCHECK_EQ(key_system_properties_map_.count(properties->GetKeySystemName()), |
| 430 0u) | 434 0u) |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 727 uint32_t mask) { | 731 uint32_t mask) { |
| 728 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask); | 732 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask); |
| 729 } | 733 } |
| 730 | 734 |
| 731 MEDIA_EXPORT void AddMimeTypeCodecMask(const std::string& mime_type, | 735 MEDIA_EXPORT void AddMimeTypeCodecMask(const std::string& mime_type, |
| 732 uint32_t mask) { | 736 uint32_t mask) { |
| 733 KeySystemsImpl::GetInstance()->AddMimeTypeCodecMask(mime_type, mask); | 737 KeySystemsImpl::GetInstance()->AddMimeTypeCodecMask(mime_type, mask); |
| 734 } | 738 } |
| 735 | 739 |
| 736 } // namespace media | 740 } // namespace media |
| OLD | NEW |