OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/cdm/renderer/widevine_key_system_properties.h" | 5 #include "components/cdm/renderer/widevine_key_system_properties.h" |
6 | 6 |
7 #include "ppapi/features/features.h" | 7 #include "ppapi/features/features.h" |
8 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | 8 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
9 | 9 |
10 #if defined(WIDEVINE_CDM_AVAILABLE) | 10 #if defined(WIDEVINE_CDM_AVAILABLE) |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
112 // robustness requirement is not supported. | 112 // robustness requirement is not supported. |
113 if ((max_robustness == Robustness::HW_SECURE_CRYPTO && | 113 if ((max_robustness == Robustness::HW_SECURE_CRYPTO && |
114 robustness == Robustness::SW_SECURE_DECODE) || | 114 robustness == Robustness::SW_SECURE_DECODE) || |
115 (max_robustness == Robustness::SW_SECURE_DECODE && | 115 (max_robustness == Robustness::SW_SECURE_DECODE && |
116 robustness == Robustness::HW_SECURE_CRYPTO) || | 116 robustness == Robustness::HW_SECURE_CRYPTO) || |
117 robustness > max_robustness) { | 117 robustness > max_robustness) { |
118 return EmeConfigRule::NOT_SUPPORTED; | 118 return EmeConfigRule::NOT_SUPPORTED; |
119 } | 119 } |
120 | 120 |
121 #if defined(OS_CHROMEOS) | 121 #if defined(OS_CHROMEOS) |
122 // TODO(ddorwin): Remove this once we have confirmed it is not necessary. | |
123 // See https://crbug.com/482277 | |
124 if (robustness == Robustness::EMPTY) | |
125 return EmeConfigRule::SUPPORTED; | |
126 | |
127 // Hardware security requires remote attestation. | 122 // Hardware security requires remote attestation. |
128 if (robustness >= Robustness::HW_SECURE_CRYPTO) | 123 if (robustness >= Robustness::HW_SECURE_CRYPTO) |
129 return EmeConfigRule::IDENTIFIER_REQUIRED; | 124 return EmeConfigRule::IDENTIFIER_REQUIRED; |
130 | 125 |
131 // For video, recommend remote attestation if HW_SECURE_ALL is available, | 126 // For video, recommend remote attestation if HW_SECURE_ALL is available, |
127 // regardless of the value of |robustness|, even when it's Robustness::EMPTY, | |
ddorwin
2016/11/18 23:50:07
EMPTY is not supposed to be special, so there is n
xhwang
2016/11/21 18:13:46
Done.
| |
132 // because it enables hardware accelerated decoding. | 128 // because it enables hardware accelerated decoding. |
133 // TODO(sandersd): Only do this when hardware accelerated decoding is | 129 // TODO(sandersd): Only do this when hardware accelerated decoding is |
134 // available for the requested codecs. | 130 // available for the requested codecs. |
135 if (media_type == EmeMediaType::VIDEO && | 131 if (media_type == EmeMediaType::VIDEO && |
136 max_robustness == Robustness::HW_SECURE_ALL) { | 132 max_robustness == Robustness::HW_SECURE_ALL) { |
137 return EmeConfigRule::IDENTIFIER_RECOMMENDED; | 133 return EmeConfigRule::IDENTIFIER_RECOMMENDED; |
138 } | 134 } |
139 #elif defined(OS_ANDROID) | 135 #elif defined(OS_ANDROID) |
140 // Require hardware secure codecs when SW_SECURE_DECODE or above is specified. | 136 // Require hardware secure codecs when SW_SECURE_DECODE or above is specified. |
141 if (robustness >= Robustness::SW_SECURE_DECODE) { | 137 if (robustness >= Robustness::SW_SECURE_DECODE) { |
(...skipping 26 matching lines...) Expand all Loading... | |
168 | 164 |
169 #if BUILDFLAG(ENABLE_PEPPER_CDMS) | 165 #if BUILDFLAG(ENABLE_PEPPER_CDMS) |
170 std::string WidevineKeySystemProperties::GetPepperType() const { | 166 std::string WidevineKeySystemProperties::GetPepperType() const { |
171 return kWidevineCdmPluginMimeType; | 167 return kWidevineCdmPluginMimeType; |
172 } | 168 } |
173 #endif | 169 #endif |
174 | 170 |
175 } // namespace cdm | 171 } // namespace cdm |
176 | 172 |
177 #endif // WIDEVINE_CDM_AVAILABLE | 173 #endif // WIDEVINE_CDM_AVAILABLE |
OLD | NEW |