From 7f249574a351c6185d2892a7610efdd70c24cedb Mon Sep 17 00:00:00 2001 From: Andreas Pehrson Date: Fri, 23 Feb 2018 15:52:03 +0100 Subject: [PATCH] Bug 1440356 - Combine CaptureState for all child windows when calculating overall state. r=johannh --HG-- extra : rebase_source : 488c2c705b250e4b4fdb7254245946ec2046c8c9 extra : histedit_source : 899c13c81d62e77610150734de629b6143e9f563 --- dom/media/MediaManager.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp index abcd4fdd54ef..f022a941ddee 100644 --- a/dom/media/MediaManager.cpp +++ b/dom/media/MediaManager.cpp @@ -3602,12 +3602,18 @@ MediaManager::MediaCaptureWindowState(nsIDOMWindow* aCapturedWindow, [&camera, µphone, &screen, &window, &application, &browser] (GetUserMediaWindowListener* aListener) { - camera = aListener->CapturingSource(MediaSourceEnum::Camera); - microphone = aListener->CapturingSource(MediaSourceEnum::Microphone); - screen = aListener->CapturingSource(MediaSourceEnum::Screen); - window = aListener->CapturingSource(MediaSourceEnum::Window); - application = aListener->CapturingSource(MediaSourceEnum::Application); - browser = aListener->CapturingSource(MediaSourceEnum::Browser); + 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)); }); }