Bug 1037438 - implement persistent deny permissions for screen sharing, r=jesup,past.
☠☠ backed out by 7b6efd055620 ☠ ☠
authorFlorian Quèze <florian@queze.net>
Mon, 28 Nov 2016 12:29:31 +0100
changeset 324434 ca8ca07756ab80d29778329aa22ebc453f17fc69
parent 324433 b05c8f63d8a2bbcbc95c40cb462f80d4a962be2d
child 324435 77b01f2bda7f4737ad3573103c05ccea895d1a39
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersjesup, past
bugs1037438
milestone53.0a1
Bug 1037438 - implement persistent deny permissions for screen sharing, r=jesup,past.
browser/modules/webrtcUI.jsm
dom/media/MediaManager.cpp
--- a/browser/modules/webrtcUI.jsm
+++ b/browser/modules/webrtcUI.jsm
@@ -307,17 +307,17 @@ function prompt(aBrowser, aRequest) {
       accessKey: stringBundle.getString("getUserMedia.dontAllow.accesskey"),
       callback: function(aState) {
         denyRequest(notification.browser, aRequest);
         if (aState && aState.checkboxChecked) {
           let perms = Services.perms;
           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);
         }
       }
     }
   ];
 
   let productName = gBrandBundle.GetStringFromName("brandShortName");
 
   // Disable the permanent 'Allow' action if the connection isn't secure, or for
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -2260,17 +2260,18 @@ if (privileged) {
       rv = permManager->TestExactPermissionFromPrincipal(
         principal, "microphone", &audioPerm);
       NS_ENSURE_SUCCESS(rv, rv);
     }
 
     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);
     }
 
     if ((!IsOn(c.mAudio) && !IsOn(c.mVideo)) ||
         (IsOn(c.mAudio) && audioPerm == nsIPermissionManager::DENY_ACTION) ||
         (IsOn(c.mVideo) && videoPerm == nsIPermissionManager::DENY_ACTION)) {
       RefPtr<MediaStreamError> error =
           new MediaStreamError(aWindow, NS_LITERAL_STRING("NotAllowedError"));