[MediaStream] Force system camera/microphone TCC prompt if necessary
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Dec 2018 21:25:29 +0000 (21:25 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Dec 2018 21:25:29 +0000 (21:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192820
<rdar://problem/42680098>

Reviewed by Jer Noble.

Source/WebKit:

* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Enable TCC check
and prompt on Mojave.

Source/WTF:

* wtf/Platform.h: Define HAVE_AUTHORIZATION_STATUS_FOR_MEDIA_TYPE.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239389 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Cocoa/UIDelegate.mm

index f54952c..057b6d9 100644 (file)
@@ -1,3 +1,13 @@
+2018-12-19  Eric Carlson  <eric.carlson@apple.com>
+
+        [MediaStream] Force system camera/microphone TCC prompt if necessary
+        https://bugs.webkit.org/show_bug.cgi?id=192820
+        <rdar://problem/42680098>
+
+        Reviewed by Jer Noble.
+
+        * wtf/Platform.h: Define HAVE_AUTHORIZATION_STATUS_FOR_MEDIA_TYPE.
+
 2018-12-17  Chris Fleizach  <cfleizach@apple.com>
 
         Some builds are broken after r239262
index b859f4a..c68b2ae 100644 (file)
 #if PLATFORM(MAC)
 #define ENABLE_FULL_KEYBOARD_ACCESS 1
 #endif
+
+#if PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101400)
+#define HAVE_AUTHORIZATION_STATUS_FOR_MEDIA_TYPE 1
+#endif
index e116f47..0904517 100644 (file)
@@ -1,3 +1,15 @@
+2018-12-19  Eric Carlson  <eric.carlson@apple.com>
+
+        [MediaStream] Force system camera/microphone TCC prompt if necessary
+        https://bugs.webkit.org/show_bug.cgi?id=192820
+        <rdar://problem/42680098>
+
+        Reviewed by Jer Noble.
+
+        * UIProcess/Cocoa/UIDelegate.mm:
+        (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Enable TCC check 
+        and prompt on Mojave.
+
 2018-12-19  Megan Gardner  <megan_gardner@apple.com>
 
         Allow clients to set the navigator platform
index ce84a88..0ed9308 100644 (file)
@@ -55,7 +55,7 @@
 #import <wtf/BlockPtr.h>
 #import <wtf/URL.h>
 
-#if PLATFORM(IOS_FAMILY)
+#if HAVE(AUTHORIZATION_STATUS_FOR_MEDIA_TYPE)
 #import <AVFoundation/AVCaptureDevice.h>
 #import <AVFoundation/AVMediaFormat.h>
 #import <wtf/SoftLinking.h>
@@ -912,7 +912,7 @@ bool UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest(WebPageProx
         return true;
     }
 
-#if PLATFORM(IOS_FAMILY)
+#if HAVE(AUTHORIZATION_STATUS_FOR_MEDIA_TYPE)
     bool usingMockCaptureDevices = page.preferences().mockCaptureDevicesEnabled();
     auto requestCameraAuthorization = makeBlockPtr([this, &frame, protectedRequest = makeRef(request), webView = RetainPtr<WKWebView>(m_uiDelegate.m_webView), usingMockCaptureDevices]() {