Title: [287261] trunk/Source/WebKit
Revision
287261
Author
you...@apple.com
Date
2021-12-20 08:04:07 -0800 (Mon, 20 Dec 2021)

Log Message

Improve UserMediaPermissionRequestManagerProxy logging
https://bugs.webkit.org/show_bug.cgi?id=234508

Reviewed by Eric Carlson.

Make sure the log identifier is correct and log whether there are cameras and/or microphones exposed.
No observable change of behavior.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (287260 => 287261)


--- trunk/Source/WebKit/ChangeLog	2021-12-20 16:01:01 UTC (rev 287260)
+++ trunk/Source/WebKit/ChangeLog	2021-12-20 16:04:07 UTC (rev 287261)
@@ -1,3 +1,16 @@
+2021-12-20  Youenn Fablet  <you...@apple.com>
+
+        Improve UserMediaPermissionRequestManagerProxy logging
+        https://bugs.webkit.org/show_bug.cgi?id=234508
+
+        Reviewed by Eric Carlson.
+
+        Make sure the log identifier is correct and log whether there are cameras and/or microphones exposed.
+        No observable change of behavior.
+
+        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
+        (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
+
 2021-12-19  Wenson Hsieh  <wenson_hs...@apple.com>
 
         Add client layer plumbing for classifying modal container controls

Modified: trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp (287260 => 287261)


--- trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp	2021-12-20 16:01:01 UTC (rev 287260)
+++ trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp	2021-12-20 16:04:07 UTC (rev 287261)
@@ -737,7 +737,7 @@
     static const unsigned defaultMaximumCameraCount = 1;
     static const unsigned defaultMaximumMicrophoneCount = 1;
 
-    platformGetMediaStreamDevices([this, weakThis = WeakPtr { *this }, revealIdsAndLabels, completion = WTFMove(completion)](auto&& devices) mutable {
+    platformGetMediaStreamDevices([logIdentifier = LOGIDENTIFIER, this, weakThis = WeakPtr { *this }, revealIdsAndLabels, completion = WTFMove(completion)](auto&& devices) mutable {
 
         if (!weakThis) {
             completion({ });
@@ -747,11 +747,15 @@
         unsigned cameraCount = 0;
         unsigned microphoneCount = 0;
 
+        bool hasCamera = false;
+        bool hasMicrophone = false;
+
         Vector<CaptureDevice> filteredDevices;
         for (const auto& device : devices) {
             if (!device.enabled() || (device.type() != WebCore::CaptureDevice::DeviceType::Camera && device.type() != WebCore::CaptureDevice::DeviceType::Microphone && device.type() != WebCore::CaptureDevice::DeviceType::Speaker))
                 continue;
-
+            hasCamera |= device.type() == WebCore::CaptureDevice::DeviceType::Camera;
+            hasMicrophone |= device.type() == WebCore::CaptureDevice::DeviceType::Microphone;
             if (!revealIdsAndLabels) {
                 if (device.type() == WebCore::CaptureDevice::DeviceType::Camera && ++cameraCount > defaultMaximumCameraCount)
                     continue;
@@ -769,7 +773,7 @@
         }
 
         m_hasFilteredDeviceList = !revealIdsAndLabels;
-        ALWAYS_LOG(LOGIDENTIFIER, filteredDevices.size(), " devices revealed");
+        ALWAYS_LOG(logIdentifier, filteredDevices.size(), " devices revealed, has filtering = ", !revealIdsAndLabels, " has camera = ", hasCamera, ", has microphone = ", hasMicrophone, " ");
 
         completion(WTFMove(filteredDevices));
     });
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to