Commit 0d6abd6e authored by Clark DuVall's avatar Clark DuVall Committed by Commit Bot

[WebLayer] Fix crash in weblayer_shell on desktop

permissions::PermissionManager::PermissionTypeToContentSetting DCHECKs
when called on PROTECTED_MEDIA_IDENTIFIER on desktop, since it is
Android/ChromeOS only.

Change-Id: Ie9e69ed5edda49fee03e44980acaf864d9776d2c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2134502
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Auto-Submit: Clark DuVall <cduvall@chromium.org>
Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756116}
parent e10e6939
...@@ -66,14 +66,21 @@ permissions::PermissionManager::PermissionContextMap CreatePermissionContexts( ...@@ -66,14 +66,21 @@ permissions::PermissionManager::PermissionContextMap CreatePermissionContexts(
browser_context, browser_context,
std::make_unique<GeolocationPermissionContextDelegate>()); std::make_unique<GeolocationPermissionContextDelegate>());
#if defined(OS_CHROMEOS) || defined(OS_ANDROID)
permission_contexts[ContentSettingsType::PROTECTED_MEDIA_IDENTIFIER] = permission_contexts[ContentSettingsType::PROTECTED_MEDIA_IDENTIFIER] =
std::make_unique<SafePermissionContext>( std::make_unique<SafePermissionContext>(
browser_context, ContentSettingsType::PROTECTED_MEDIA_IDENTIFIER, browser_context, ContentSettingsType::PROTECTED_MEDIA_IDENTIFIER,
blink::mojom::FeaturePolicyFeature::kEncryptedMedia); blink::mojom::FeaturePolicyFeature::kEncryptedMedia);
#endif
// For now, all requests are denied. As features are added, their permission // For now, all requests are denied. As features are added, their permission
// contexts can be added here instead of DeniedPermissionContext. // contexts can be added here instead of DeniedPermissionContext.
for (content::PermissionType type : content::GetAllPermissionTypes()) { for (content::PermissionType type : content::GetAllPermissionTypes()) {
#if !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
// PROTECTED_MEDIA_IDENTIFIER is only supported on Android/ChromeOS.
if (type == content::PermissionType::PROTECTED_MEDIA_IDENTIFIER)
continue;
#endif
ContentSettingsType content_settings_type = ContentSettingsType content_settings_type =
permissions::PermissionManager::PermissionTypeToContentSetting(type); permissions::PermissionManager::PermissionTypeToContentSetting(type);
if (permission_contexts.find(content_settings_type) == if (permission_contexts.find(content_settings_type) ==
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment