Title: [219330] trunk/Source/WebKit2
Revision
219330
Author
[email protected]
Date
2017-07-11 08:14:36 -0700 (Tue, 11 Jul 2017)

Log Message

Changing the web page muted state for playing audio should not disable other tabs capture
https://bugs.webkit.org/show_bug.cgi?id=174349
rdar://problem/33223988

Patch by Youenn Fablet <[email protected]> on 2017-07-11
Reviewed by Eric Carlson.

Make sure to mute capturing streams of any other tab if the current tab will start capturing or will unmute existing capturing streams.
Manually tested by having a tab doing capture and another tab playing a video.
Muting or unmuting the tab playing video should not change the capture tab.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::activateMediaStreamCaptureInPage):
(WebKit::WebPageProxy::setMuted):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::activateMediaStreamCaptureInPage):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (219329 => 219330)


--- trunk/Source/WebKit2/ChangeLog	2017-07-11 14:59:25 UTC (rev 219329)
+++ trunk/Source/WebKit2/ChangeLog	2017-07-11 15:14:36 UTC (rev 219330)
@@ -1,5 +1,23 @@
 2017-07-11  Youenn Fablet  <[email protected]>
 
+        Changing the web page muted state for playing audio should not disable other tabs capture
+        https://bugs.webkit.org/show_bug.cgi?id=174349
+        rdar://problem/33223988
+
+        Reviewed by Eric Carlson.
+
+        Make sure to mute capturing streams of any other tab if the current tab will start capturing or will unmute existing capturing streams.
+        Manually tested by having a tab doing capture and another tab playing a video.
+        Muting or unmuting the tab playing video should not change the capture tab.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::activateMediaStreamCaptureInPage):
+        (WebKit::WebPageProxy::setMuted):
+        * UIProcess/WebPageProxy.h:
+        (WebKit::WebPageProxy::activateMediaStreamCaptureInPage):
+
+2017-07-11  Youenn Fablet  <[email protected]>
+
         NetworkProcess should close listening WebRTC sockets when being suspended
         https://bugs.webkit.org/show_bug.cgi?id=174270
         rdar://problem/33139844

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (219329 => 219330)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2017-07-11 14:59:25 UTC (rev 219329)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2017-07-11 15:14:36 UTC (rev 219330)
@@ -1666,7 +1666,13 @@
     else
         setMuted(m_mutedState & ~WebCore::MediaProducer::CaptureDevicesAreMuted);
 }
-    
+
+void WebPageProxy::activateMediaStreamCaptureInPage()
+{
+    UserMediaProcessManager::singleton().muteCaptureMediaStreamsExceptIn(*this);
+    setMuted(m_mutedState & ~WebCore::MediaProducer::CaptureDevicesAreMuted);
+}
+
 #if !PLATFORM(IOS)
 void WebPageProxy::didCommitLayerTree(const RemoteLayerTreeTransaction&)
 {
@@ -4138,7 +4144,8 @@
         return;
 
 #if ENABLE(MEDIA_STREAM)
-    if (!(state & WebCore::MediaProducer::CaptureDevicesAreMuted))
+    bool hasMutedCaptureStreams = m_mediaState & (WebCore::MediaProducer::HasMutedAudioCaptureDevice | WebCore::MediaProducer::HasMutedVideoCaptureDevice);
+    if (hasMutedCaptureStreams && !(state & WebCore::MediaProducer::CaptureDevicesAreMuted))
         UserMediaProcessManager::singleton().muteCaptureMediaStreamsExceptIn(*this);
 #endif
 

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (219329 => 219330)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2017-07-11 14:59:25 UTC (rev 219329)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2017-07-11 15:14:36 UTC (rev 219330)
@@ -475,7 +475,7 @@
     void setEditable(bool);
     bool isEditable() const { return m_isEditable; }
 
-    void activateMediaStreamCaptureInPage() { setMuted(m_mutedState & ~WebCore::MediaProducer::CaptureDevicesAreMuted); }
+    void activateMediaStreamCaptureInPage();
     bool isMediaStreamCaptureMuted() const { return m_mutedState & WebCore::MediaProducer::CaptureDevicesAreMuted; }
     void setMediaStreamCaptureMuted(bool);
         
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to