fix: video and audio capture should be separate (#42807)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot] 2024-07-09 11:44:22 +02:00 committed by GitHub
parent df6a3583cb
commit 5271a49fe8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 39 additions and 5 deletions

View file

@ -282,10 +282,10 @@ bool WebContentsPermissionHelper::CheckMediaAccessPermission(
base::Value::Dict details;
details.Set("securityOrigin", security_origin.GetURL().spec());
details.Set("mediaType", MediaStreamTypeToString(type));
// The permission type doesn't matter here, AUDIO_CAPTURE/VIDEO_CAPTURE
// are presented as same type in content_converter.h.
return CheckPermission(blink::PermissionType::AUDIO_CAPTURE,
std::move(details));
auto blink_type = type == blink::mojom::MediaStreamType::DEVICE_AUDIO_CAPTURE
? blink::PermissionType::AUDIO_CAPTURE
: blink::PermissionType::VIDEO_CAPTURE;
return CheckPermission(blink_type, std::move(details));
}
bool WebContentsPermissionHelper::CheckSerialAccessPermission(