Bug 1287827 - Part 5. Remove Loop's special permissions for about:loopconversation from MediaManager. r=jib
☠☠ backed out by 27573cdada04 ☠ ☠
authorMark Banner <standard8@mozilla.com>
Wed, 27 Jul 2016 11:42:26 +0100
changeset 347257 f5f1c014ca19fdff1b98ca14b84fd09c48b02e7c
parent 347256 82d62650cfe466f696f2f61d6838ca84c63d1013
child 347258 0ed2256fd1fdc19d545c88ec95ad09987321b604
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1287827
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1287827 - Part 5. Remove Loop's special permissions for about:loopconversation from MediaManager. r=jib
dom/media/MediaManager.cpp
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -2069,17 +2069,17 @@ MediaManager::GetUserMedia(nsPIDOMWindow
 
   // Determine permissions early (while we still have a stack).
 
   nsIURI* docURI = aWindow->GetDocumentURI();
   if (!docURI) {
     return NS_ERROR_UNEXPECTED;
   }
   bool loop = IsLoop(docURI);
-  bool privileged = loop || IsPrivileged();
+  bool privileged = IsPrivileged();
   bool isHTTPS = false;
   docURI->SchemeIs("https", &isHTTPS);
   nsCString host;
   nsresult rv = docURI->GetHost(host);
   // Test for some other schemes that ServiceWorker recognizes
   bool isFile;
   docURI->SchemeIs("file", &isFile);
   bool isApp;
@@ -2163,17 +2163,17 @@ MediaManager::GetUserMedia(nsPIDOMWindow
 #if defined(XP_WIN)
             (
               // Allow tab sharing for all platforms including XP
               (videoType != MediaSourceEnum::Browser) &&
               !Preferences::GetBool("media.getusermedia.screensharing.allow_on_old_platforms",
                                     false) && !IsVistaOrLater()) ||
 #endif
             (!privileged && !HostIsHttps(*docURI)) ||
-            !(loop || HostHasPermission(*docURI))) {
+            !HostHasPermission(*docURI)) {
           RefPtr<MediaStreamError> error =
               new MediaStreamError(aWindow,
                                    NS_LITERAL_STRING("NotAllowedError"));
           onFailure->OnError(error);
           return NS_OK;
         }
         break;
 
@@ -2208,26 +2208,16 @@ MediaManager::GetUserMedia(nsPIDOMWindow
       if (vc.mAdvanced.WasPassed()) {
         for (MediaTrackConstraintSet& cs : vc.mAdvanced.Value()) {
           if (cs.mBrowserWindow.WasPassed()) {
             cs.mBrowserWindow.Value() = -1;
           }
         }
       }
     }
-
-    // For all but tab sharing, Loop needs to prompt as we are using the
-    // permission menu for selection of the device currently. For tab sharing,
-    // Loop has implicit permissions within Firefox, as it is built-in,
-    // and will manage the active tab and provide appropriate UI.
-    if (loop && (videoType == MediaSourceEnum::Window ||
-                 videoType == MediaSourceEnum::Application ||
-                 videoType == MediaSourceEnum::Screen)) {
-       privileged = false;
-    }
   } else if (IsOn(c.mVideo)) {
     videoType = MediaSourceEnum::Camera;
   }
 
   if (c.mAudio.IsMediaTrackConstraints()) {
     auto& ac = c.mAudio.GetAsMediaTrackConstraints();
     audioType = StringToEnum(dom::MediaSourceEnumValues::strings,
                              ac.mMediaSource,