From 4d0f83f3877695e0679e86934907b00474844451 Mon Sep 17 00:00:00 2001 From: Dan Minor Date: Tue, 30 Apr 2019 15:06:23 +0000 Subject: [PATCH] Bug 1497559 - Remove Application from mediaCaptureWindowState; r=jib Differential Revision: https://phabricator.services.mozilla.com/D28093 --HG-- extra : moz-landing-system : lando --- browser/actors/WebRTCChild.jsm | 11 ++--------- .../test/webrtc/get_user_media_content_script.js | 5 +---- dom/media/MediaManager.cpp | 12 +++--------- dom/media/nsIMediaManager.idl | 1 - 4 files changed, 6 insertions(+), 23 deletions(-) diff --git a/browser/actors/WebRTCChild.jsm b/browser/actors/WebRTCChild.jsm index ba5c24134569..e7e5187d2822 100644 --- a/browser/actors/WebRTCChild.jsm +++ b/browser/actors/WebRTCChild.jsm @@ -341,9 +341,6 @@ function updateIndicators(aSubject, aTopic, aData) { } 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"; @@ -376,25 +373,21 @@ function removeBrowserSpecificIndicator(aSubject, aTopic, aData) { } 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"; diff --git a/browser/base/content/test/webrtc/get_user_media_content_script.js b/browser/base/content/test/webrtc/get_user_media_content_script.js index 0e753cf9116b..dd0d59c700dc 100644 --- a/browser/base/content/test/webrtc/get_user_media_content_script.js +++ b/browser/base/content/test/webrtc/get_user_media_content_script.js @@ -70,12 +70,11 @@ function _getMediaCaptureState() { 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) @@ -87,8 +86,6 @@ function _getMediaCaptureState() { 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"; diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp index 52ff139a90db..7c4d33d8ccb8 100644 --- a/dom/media/MediaManager.cpp +++ b/dom/media/MediaManager.cpp @@ -3857,7 +3857,6 @@ 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()); @@ -3865,13 +3864,12 @@ MediaManager::MediaCaptureWindowState(nsIDOMWindow* aCapturedWindow, CaptureState microphone = CaptureState::Off; CaptureState screen = CaptureState::Off; CaptureState window = CaptureState::Off; - CaptureState application = CaptureState::Off; CaptureState browser = CaptureState::Off; nsCOMPtr piWin = do_QueryInterface(aCapturedWindow); if (piWin) { IterateWindowListeners( - piWin, [&camera, µphone, &screen, &window, &application, + piWin, [&camera, µphone, &screen, &window, &browser](const RefPtr& aListener) { camera = CombineCaptureState( camera, aListener->CapturingSource(MediaSourceEnum::Camera)); @@ -3882,9 +3880,6 @@ MediaManager::MediaCaptureWindowState(nsIDOMWindow* aCapturedWindow, 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)); }); @@ -3894,10 +3889,9 @@ MediaManager::MediaCaptureWindowState(nsIDOMWindow* aCapturedWindow, *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)" @@ -3910,7 +3904,7 @@ MediaManager::MediaCaptureWindowState(nsIDOMWindow* aCapturedWindow, ? "microphone (disabled)" : ""), *aScreen ? "screenshare" : "", *aWindow ? "windowshare" : "", - *aApplication ? "appshare" : "", *aBrowser ? "browsershare" : ""); + *aBrowser ? "browsershare" : ""); return NS_OK; } diff --git a/dom/media/nsIMediaManager.idl b/dom/media/nsIMediaManager.idl index 199b81f73092..c2f3e2132c33 100644 --- a/dom/media/nsIMediaManager.idl +++ b/dom/media/nsIMediaManager.idl @@ -29,7 +29,6 @@ interface nsIMediaManagerService : nsISupports 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