Bug 1497559 - Remove Application from mediaCaptureWindowState; r=jib

Differential Revision: https://phabricator.services.mozilla.com/D28093

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Dan Minor 2019-04-30 15:06:23 +00:00
Родитель 7b91688f1b
Коммит 4d0f83f387
4 изменённых файлов: 6 добавлений и 23 удалений

Просмотреть файл

@ -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";

Просмотреть файл

@ -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";

Просмотреть файл

@ -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<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));
@ -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;
}

Просмотреть файл

@ -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