Bug 1497559 - Remove Application from mediaCaptureWindowState; r=jib
authorDan Minor <dminor@mozilla.com>
Tue, 30 Apr 2019 15:06:23 +0000
changeset 530933 d4662bda99817b8b9e22942afc9e9c3fa64ac84b
parent 530932 82f244c85df1d1e5565340e69477a90f0525fae6
child 530934 be001f8ade5a8e8fcd9c6e32f987a829b589d7e3
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1497559
milestone68.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 1497559 - Remove Application from mediaCaptureWindowState; r=jib Differential Revision: https://phabricator.services.mozilla.com/D28093
browser/actors/WebRTCChild.jsm
browser/base/content/test/webrtc/get_user_media_content_script.js
dom/media/MediaManager.cpp
dom/media/nsIMediaManager.idl
--- a/browser/actors/WebRTCChild.jsm
+++ b/browser/actors/WebRTCChild.jsm
@@ -336,19 +336,16 @@ function updateIndicators(aSubject, aTop
       state.showMicrophoneIndicator = true;
     }
     if (tabState.screen) {
       if (tabState.screen.startsWith("Screen")) {
         state.showScreenSharingIndicator = "Screen";
       } else if (tabState.screen.startsWith("Window")) {
         if (state.showScreenSharingIndicator != "Screen")
           state.showScreenSharingIndicator = "Window";
-      } else if (tabState.screen.startsWith("Application")) {
-        if (!state.showScreenSharingIndicator)
-          state.showScreenSharingIndicator = "Application";
       } else if (tabState.screen.startsWith("Browser")) {
         if (!state.showScreenSharingIndicator)
           state.showScreenSharingIndicator = "Browser";
       }
     }
 
     let mm = getMessageManagerForWindow(contentWindow);
     mm.sendAsyncMessage("webrtc:UpdateBrowserIndicators", tabState);
@@ -371,35 +368,31 @@ function removeBrowserSpecificIndicator(
     tabState = {windowId: tabState.windowId};
 
   let mm = getMessageManagerForWindow(contentWindow);
   if (mm)
     mm.sendAsyncMessage("webrtc:UpdateBrowserIndicators", tabState);
 }
 
 function getTabStateForContentWindow(aContentWindow) {
-  let camera = {}, microphone = {}, screen = {}, window = {}, app = {}, browser = {};
+  let camera = {}, microphone = {}, screen = {}, window = {}, browser = {};
   MediaManagerService.mediaCaptureWindowState(aContentWindow,
                                               camera, microphone,
-                                              screen, window, app, browser);
+                                              screen, window, browser);
   let tabState = {camera: camera.value, microphone: microphone.value};
   if (screen.value == MediaManagerService.STATE_CAPTURE_ENABLED)
     tabState.screen = "Screen";
   else if (window.value == MediaManagerService.STATE_CAPTURE_ENABLED)
     tabState.screen = "Window";
-  else if (app.value == MediaManagerService.STATE_CAPTURE_ENABLED)
-    tabState.screen = "Application";
   else if (browser.value == MediaManagerService.STATE_CAPTURE_ENABLED)
     tabState.screen = "Browser";
   else if (screen.value == MediaManagerService.STATE_CAPTURE_DISABLED)
     tabState.screen = "ScreenPaused";
   else if (window.value == MediaManagerService.STATE_CAPTURE_DISABLED)
     tabState.screen = "WindowPaused";
-  else if (app.value == MediaManagerService.STATE_CAPTURE_DISABLED)
-    tabState.screen = "ApplicationPaused";
   else if (browser.value == MediaManagerService.STATE_CAPTURE_DISABLED)
     tabState.screen = "BrowserPaused";
 
   let screenEnabled = tabState.screen && !tabState.screen.includes("Paused");
   let cameraEnabled = tabState.camera == MediaManagerService.STATE_CAPTURE_ENABLED;
   let microphoneEnabled = tabState.microphone == MediaManagerService.STATE_CAPTURE_ENABLED;
 
   // tabState.sharing controls which global indicator should be shown
--- a/browser/base/content/test/webrtc/get_user_media_content_script.js
+++ b/browser/base/content/test/webrtc/get_user_media_content_script.js
@@ -65,35 +65,32 @@ addMessageListener("Test:ExpectNoObserve
   gObservedTopics = {};
 });
 
 function _getMediaCaptureState() {
   let hasCamera = {};
   let hasMicrophone = {};
   let hasScreenShare = {};
   let hasWindowShare = {};
-  let hasAppShare = {};
   let hasBrowserShare = {};
   MediaManagerService.mediaCaptureWindowState(content,
                                               hasCamera, hasMicrophone,
                                               hasScreenShare, hasWindowShare,
-                                              hasAppShare, hasBrowserShare);
+                                              hasBrowserShare);
   let result = {};
 
   if (hasCamera.value != MediaManagerService.STATE_NOCAPTURE)
     result.video = true;
   if (hasMicrophone.value != MediaManagerService.STATE_NOCAPTURE)
     result.audio = true;
 
   if (hasScreenShare.value != MediaManagerService.STATE_NOCAPTURE)
     result.screen = "Screen";
   else if (hasWindowShare.value != MediaManagerService.STATE_NOCAPTURE)
     result.screen = "Window";
-  else if (hasAppShare.value != MediaManagerService.STATE_NOCAPTURE)
-    result.screen = "Application";
   else if (hasBrowserShare.value != MediaManagerService.STATE_NOCAPTURE)
     result.screen = "Browser";
 
   return result;
 }
 
 addMessageListener("Test:GetMediaCaptureState", data => {
   sendAsyncMessage("Test:MediaCaptureState", _getMediaCaptureState());
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -3852,70 +3852,64 @@ struct CaptureWindowStateData {
   uint16_t* mAppShare;
   uint16_t* mBrowserShare;
 };
 
 NS_IMETHODIMP
 MediaManager::MediaCaptureWindowState(nsIDOMWindow* aCapturedWindow,
                                       uint16_t* aCamera, uint16_t* aMicrophone,
                                       uint16_t* aScreen, uint16_t* aWindow,
-                                      uint16_t* aApplication,
                                       uint16_t* aBrowser) {
   MOZ_ASSERT(NS_IsMainThread());
 
   CaptureState camera = CaptureState::Off;
   CaptureState microphone = CaptureState::Off;
   CaptureState screen = CaptureState::Off;
   CaptureState window = CaptureState::Off;
-  CaptureState application = CaptureState::Off;
   CaptureState browser = CaptureState::Off;
 
   nsCOMPtr<nsPIDOMWindowInner> piWin = do_QueryInterface(aCapturedWindow);
   if (piWin) {
     IterateWindowListeners(
-        piWin, [&camera, &microphone, &screen, &window, &application,
+        piWin, [&camera, &microphone, &screen, &window,
                 &browser](const RefPtr<GetUserMediaWindowListener>& aListener) {
           camera = CombineCaptureState(
               camera, aListener->CapturingSource(MediaSourceEnum::Camera));
           microphone = CombineCaptureState(
               microphone,
               aListener->CapturingSource(MediaSourceEnum::Microphone));
           screen = CombineCaptureState(
               screen, aListener->CapturingSource(MediaSourceEnum::Screen));
           window = CombineCaptureState(
               window, aListener->CapturingSource(MediaSourceEnum::Window));
-          application = CombineCaptureState(
-              application,
-              aListener->CapturingSource(MediaSourceEnum::Application));
           browser = CombineCaptureState(
               browser, aListener->CapturingSource(MediaSourceEnum::Browser));
         });
   }
 
   *aCamera = FromCaptureState(camera);
   *aMicrophone = FromCaptureState(microphone);
   *aScreen = FromCaptureState(screen);
   *aWindow = FromCaptureState(window);
-  *aApplication = FromCaptureState(application);
   *aBrowser = FromCaptureState(browser);
 
-  LOG("%s: window %" PRIu64 " capturing %s %s %s %s %s %s", __FUNCTION__,
+  LOG("%s: window %" PRIu64 " capturing %s %s %s %s %s", __FUNCTION__,
       piWin ? piWin->WindowID() : -1,
       *aCamera == nsIMediaManagerService::STATE_CAPTURE_ENABLED
           ? "camera (enabled)"
           : (*aCamera == nsIMediaManagerService::STATE_CAPTURE_DISABLED
                  ? "camera (disabled)"
                  : ""),
       *aMicrophone == nsIMediaManagerService::STATE_CAPTURE_ENABLED
           ? "microphone (enabled)"
           : (*aMicrophone == nsIMediaManagerService::STATE_CAPTURE_DISABLED
                  ? "microphone (disabled)"
                  : ""),
       *aScreen ? "screenshare" : "", *aWindow ? "windowshare" : "",
-      *aApplication ? "appshare" : "", *aBrowser ? "browsershare" : "");
+      *aBrowser ? "browsershare" : "");
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 MediaManager::SanitizeDeviceIds(int64_t aSinceWhen) {
   MOZ_ASSERT(NS_IsMainThread());
   LOG("%s: sinceWhen = %" PRId64, __FUNCTION__, aSinceWhen);
--- a/dom/media/nsIMediaManager.idl
+++ b/dom/media/nsIMediaManager.idl
@@ -24,15 +24,14 @@ interface nsIMediaManagerService : nsISu
   const unsigned short STATE_CAPTURE_DISABLED = 2;
 
   /* Get the capture state for the given window and all descendant windows (iframes, etc) */
   void mediaCaptureWindowState(in nsIDOMWindow aWindow,
                                out unsigned short aCamera,
                                out unsigned short aMicrophone,
                                [optional] out unsigned short aScreenShare,
                                [optional] out unsigned short aWindowShare,
-                               [optional] out unsigned short aAppShare,
                                [optional] out unsigned short aBrowserShare);
 
   /* Clear per-orgin list of persistent DeviceIds stored for enumerateDevices
      sinceTime is milliseconds since 1 January 1970 00:00:00 UTC. 0 = clear all */
   void sanitizeDeviceIds(in long long sinceWhen);
 };