From 10d60535cc0beba16b02ebab3ba9d5ce2ce86ab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Qu=C3=A8ze?= Date: Mon, 28 Nov 2016 12:29:31 +0100 Subject: [PATCH] Bug 1037438 - implement persistent deny permissions for screen sharing, r=jesup,past. --- browser/modules/webrtcUI.jsm | 2 +- dom/media/MediaManager.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/browser/modules/webrtcUI.jsm b/browser/modules/webrtcUI.jsm index 997236056e93..edba70982285 100644 --- a/browser/modules/webrtcUI.jsm +++ b/browser/modules/webrtcUI.jsm @@ -312,7 +312,7 @@ function prompt(aBrowser, aRequest) { if (audioDevices.length) perms.add(uri, "microphone", perms.DENY_ACTION); if (videoDevices.length) - perms.add(uri, "camera", perms.DENY_ACTION); + perms.add(uri, sharingScreen ? "screen" : "camera", perms.DENY_ACTION); } } } diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp index 472722b60986..ead1258826e3 100644 --- a/dom/media/MediaManager.cpp +++ b/dom/media/MediaManager.cpp @@ -2265,7 +2265,8 @@ if (privileged) { uint32_t videoPerm = nsIPermissionManager::UNKNOWN_ACTION; if (IsOn(c.mVideo)) { rv = permManager->TestExactPermissionFromPrincipal( - principal, "camera", &videoPerm); + principal, videoType == MediaSourceEnum::Camera ? "camera" : "screen", + &videoPerm); NS_ENSURE_SUCCESS(rv, rv); }