Title: [289768] trunk/Source/WebCore
Revision
289768
Author
[email protected]
Date
2022-02-14 14:56:41 -0800 (Mon, 14 Feb 2022)

Log Message

[macOS] Check feature flag before using screen/window picker
https://bugs.webkit.org/show_bug.cgi?id=236596
<rdar://problem/88909015>

Reviewed by Jer Noble.

Tested manually.

* platform/mediastream/mac/ScreenCaptureKitSharingSessionManager.mm:
(WebCore::screenCaptureKitPickerFeatureEnabled): Check feature flag.
(WebCore::ScreenCaptureKitSharingSessionManager::isAvailable):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (289767 => 289768)


--- trunk/Source/WebCore/ChangeLog	2022-02-14 22:48:41 UTC (rev 289767)
+++ trunk/Source/WebCore/ChangeLog	2022-02-14 22:56:41 UTC (rev 289768)
@@ -1,3 +1,17 @@
+2022-02-14  Eric Carlson  <[email protected]>
+
+        [macOS] Check feature flag before using screen/window picker
+        https://bugs.webkit.org/show_bug.cgi?id=236596
+        <rdar://problem/88909015>
+
+        Reviewed by Jer Noble.
+
+        Tested manually.
+
+        * platform/mediastream/mac/ScreenCaptureKitSharingSessionManager.mm:
+        (WebCore::screenCaptureKitPickerFeatureEnabled): Check feature flag.
+        (WebCore::ScreenCaptureKitSharingSessionManager::isAvailable):
+
 2022-02-14  Said Abou-Hallawa  <[email protected]>
 
         [GPU Process] Implement GraphicsContext::drawLineForText() in terms of GraphicsContext::drawLinesForText()

Modified: trunk/Source/WebCore/platform/mediastream/mac/ScreenCaptureKitSharingSessionManager.mm (289767 => 289768)


--- trunk/Source/WebCore/platform/mediastream/mac/ScreenCaptureKitSharingSessionManager.mm	2022-02-14 22:48:41 UTC (rev 289767)
+++ trunk/Source/WebCore/platform/mediastream/mac/ScreenCaptureKitSharingSessionManager.mm	2022-02-14 22:56:41 UTC (rev 289768)
@@ -30,6 +30,7 @@
 
 #import "Logging.h"
 #import "ScreenCaptureKitCaptureSource.h"
+#import <pal/spi/cocoa/FeatureFlagsSPI.h>
 #import <pal/spi/mac/ScreenCaptureKitSPI.h>
 #import <wtf/cocoa/Entitlements.h>
 
@@ -113,9 +114,20 @@
 
 namespace WebCore {
 
+static bool screenCaptureKitPickerFeatureEnabled()
+{
+    static bool enabled;
+    static std::once_flag flag;
+    std::call_once(flag, [] {
+        enabled = os_feature_enabled(ScreenCaptureKit, expanseAdoption);
+    });
+    return enabled;
+}
+
 bool ScreenCaptureKitSharingSessionManager::isAvailable()
 {
-    return WTF::processHasEntitlement("com.apple.private.screencapturekit.sharingsession")
+    return screenCaptureKitPickerFeatureEnabled()
+            && WTF::processHasEntitlement("com.apple.private.screencapturekit.sharingsession")
             && PAL::getSCContentSharingSessionClass()
             && ScreenCaptureKitCaptureSource::isAvailable();
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to