Title: [230050] trunk/Source/WebKit
Revision
230050
Author
pvol...@apple.com
Date
2018-03-28 14:17:14 -0700 (Wed, 28 Mar 2018)

Log Message

Adopt WEBPROCESS_WINDOWSERVER_BLOCKING compiler guard in WebProcess.
https://bugs.webkit.org/show_bug.cgi?id=183959
<rdar://problem/38965719>

Reviewed by Brent Fulgham.

Use the compile guard to guard the call to CGSSetDenyWindowServerConnections.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeProcess):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (230049 => 230050)


--- trunk/Source/WebKit/ChangeLog	2018-03-28 21:14:02 UTC (rev 230049)
+++ trunk/Source/WebKit/ChangeLog	2018-03-28 21:17:14 UTC (rev 230050)
@@ -1,3 +1,16 @@
+2018-03-28  Per Arne Vollan  <pvol...@apple.com>
+
+        Adopt WEBPROCESS_WINDOWSERVER_BLOCKING compiler guard in WebProcess.
+        https://bugs.webkit.org/show_bug.cgi?id=183959
+        <rdar://problem/38965719>
+
+        Reviewed by Brent Fulgham.
+
+        Use the compile guard to guard the call to CGSSetDenyWindowServerConnections.
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeProcess):
+
 2018-03-28  Brent Fulgham  <bfulg...@apple.com>
 
         Unreviewed build fix after r230045.

Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (230049 => 230050)


--- trunk/Source/WebKit/WebProcess/WebProcess.cpp	2018-03-28 21:14:02 UTC (rev 230049)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp	2018-03-28 21:17:14 UTC (rev 230050)
@@ -224,11 +224,23 @@
 
     MessagePortChannelProvider::setSharedProvider(WebMessagePortChannelProvider::singleton());
     
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if PLATFORM(MAC)
+#if ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
+    // Deny the WebContent process access to the WindowServer.
+    // We cannot call setApplicationIsDaemon here, since Activity Monitor will not show the
+    // url of the WebContent process, then.
+    // This call will not succeed if there are open WindowServer connections at this point.
+    CGError error = CGSSetDenyWindowServerConnections(true);
+    ASSERT(error == kCGErrorSuccess);
+    if (error != kCGErrorSuccess)
+        WTFLogAlways("Failed to deny WindowServer connections, error = %d", error);
+#endif
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
     // This call is needed when the WebProcess is not running the NSApplication event loop.
     // Otherwise, calling enableSandboxStyleFileQuarantine() will fail.
     launchServicesCheckIn();
 #endif
+#endif
     platformInitializeProcess(parameters);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to