Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(741)

Unified Diff: media/blink/webencryptedmediaclient_impl.cc

Issue 960793002: Restore L3 support on CrOS when the media permission is denied. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2311
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/key_systems.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webencryptedmediaclient_impl.cc
diff --git a/media/blink/webencryptedmediaclient_impl.cc b/media/blink/webencryptedmediaclient_impl.cc
index e687c27ab6ace8b1047533a807dfc8efe00d58d1..2dd051e59626ee9d47fcfd33c11c63a74c23dd3c 100644
--- a/media/blink/webencryptedmediaclient_impl.cc
+++ b/media/blink/webencryptedmediaclient_impl.cc
@@ -140,6 +140,8 @@ static ConfigurationSupport GetSupportedConfiguration(
blink::WebMediaKeySystemConfiguration* accumulated_configuration,
bool was_permission_requested,
bool is_permission_granted) {
+ DCHECK(was_permission_requested || !is_permission_granted);
+
// It is possible to obtain user permission unless permission was already
// requested and denied.
bool is_permission_possible =
@@ -302,8 +304,18 @@ static ConfigurationSupport GetSupportedConfiguration(
ConvertRequirement(accumulated_configuration->distinctiveIdentifier);
if (!IsDistinctiveIdentifierRequirementSupported(key_system, di_requirement,
is_permission_granted)) {
- DCHECK(!was_permission_requested); // Should have failed at step 3.
- return CONFIGURATION_REQUIRES_PERMISSION;
+ if (was_permission_requested) {
+ // The optional permission was requested and denied.
+ // TODO(sandersd): Avoid the need for this logic - crbug.com/460616.
+ DCHECK(candidate.distinctiveIdentifier ==
+ blink::WebMediaKeySystemConfiguration::Requirement::Optional);
+ DCHECK(di_requirement == EME_FEATURE_REQUIRED);
+ DCHECK(!is_permission_granted);
+ accumulated_configuration->distinctiveIdentifier =
+ blink::WebMediaKeySystemConfiguration::Requirement::NotAllowed;
+ } else {
+ return CONFIGURATION_REQUIRES_PERMISSION;
+ }
}
ps_requirement =
« no previous file with comments | « media/base/key_systems.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698