Title: [218916] trunk/Source/WebKit2
Revision
218916
Author
bfulg...@apple.com
Date
2017-06-28 21:04:37 -0700 (Wed, 28 Jun 2017)

Log Message

[WK2][macOS][iOS] Don't request microphone access for clients that don't need it.
https://bugs.webkit.org/show_bug.cgi?id=173948
<rdar://problem/32103275>

Reviewed by Eric Carlson.

Don't bother requesting a sandbox extension to access the microphone for any clients
on the Cocoa platform that are not Safari. Other clients don't have the necessary
system entitlements, and always fail leading to annoying SandboxViolation reports.

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (218915 => 218916)


--- trunk/Source/WebKit2/ChangeLog	2017-06-29 03:58:17 UTC (rev 218915)
+++ trunk/Source/WebKit2/ChangeLog	2017-06-29 04:04:37 UTC (rev 218916)
@@ -1,3 +1,18 @@
+2017-06-28  Brent Fulgham  <bfulg...@apple.com>
+
+        [WK2][macOS][iOS] Don't request microphone access for clients that don't need it.
+        https://bugs.webkit.org/show_bug.cgi?id=173948
+        <rdar://problem/32103275>
+
+        Reviewed by Eric Carlson.
+
+        Don't bother requesting a sandbox extension to access the microphone for any clients
+        on the Cocoa platform that are not Safari. Other clients don't have the necessary
+        system entitlements, and always fail leading to annoying SandboxViolation reports.
+
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::WebProcessPool::platformInitializeWebProcess): 
+
 2017-06-29  Zalan Bujtas  <za...@apple.com>
 
         Move RenderEmbeddedObject::isReplacementObscured to HTMLPlugInElement

Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm (218915 => 218916)


--- trunk/Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2017-06-29 03:58:17 UTC (rev 218915)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2017-06-29 04:04:37 UTC (rev 218916)
@@ -251,9 +251,18 @@
     bool webRTCEnabled = m_defaultPageGroup->preferences().peerConnectionEnabled();
     if ([defaults objectForKey:@"ExperimentalPeerConnectionEnabled"])
         webRTCEnabled = [defaults boolForKey:@"ExperimentalPeerConnectionEnabled"];
-    
+
+    bool isSafari = false;
+#if PLATFORM(IOS)
+    if (WebCore::IOSApplication::isMobileSafari())
+        isSafari = true;
+#elif PLATFORM(MAC)
+    if (WebCore::MacApplication::isSafari())
+        isSafari = true;
+#endif
+
     // FIXME: Remove this and related parameter when <rdar://problem/29448368> is fixed.
-    if (!parameters.shouldCaptureAudioInUIProcess && (mediaDevicesEnabled || webRTCEnabled))
+    if (isSafari && !parameters.shouldCaptureAudioInUIProcess && mediaDevicesEnabled)
         SandboxExtension::createHandleForGenericExtension("com.apple.webkit.microphone", parameters.audioCaptureExtensionHandle);
 #endif
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to