Title: [231307] trunk/Source/WebKit
Revision
231307
Author
pvol...@apple.com
Date
2018-05-03 09:31:53 -0700 (Thu, 03 May 2018)

Log Message

An error message is written to stderr when the WebContent process is blocking WindowServer access.
https://bugs.webkit.org/show_bug.cgi?id=184701

Reviewed by Brent Fulgham.

Calling 'setApplicationIsDaemon(true)' instead of 'CGSSetDenyWindowServerConnections(true)' to disable
access to the WindowServer in the WebContent process, will remove this error message. After this change,
the url of the WebContent process is still showing up in Activity Monitor, which previously was a
problem when calling 'setApplicationIsDaemon(true)'.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeProcess):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeProcess):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (231306 => 231307)


--- trunk/Source/WebKit/ChangeLog	2018-05-03 16:01:26 UTC (rev 231306)
+++ trunk/Source/WebKit/ChangeLog	2018-05-03 16:31:53 UTC (rev 231307)
@@ -1,3 +1,20 @@
+2018-05-03  Per Arne Vollan  <pvol...@apple.com>
+
+        An error message is written to stderr when the WebContent process is blocking WindowServer access.
+        https://bugs.webkit.org/show_bug.cgi?id=184701
+
+        Reviewed by Brent Fulgham.
+
+        Calling 'setApplicationIsDaemon(true)' instead of 'CGSSetDenyWindowServerConnections(true)' to disable
+        access to the WindowServer in the WebContent process, will remove this error message. After this change,
+        the url of the WebContent process is still showing up in Activity Monitor, which previously was a
+        problem when calling 'setApplicationIsDaemon(true)'.
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeProcess):
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::WebProcess::platformInitializeProcess):
+
 2018-05-03  Ryan Haddad  <ryanhad...@apple.com>
 
         Unreviewed, rolling out r231253.

Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (231306 => 231307)


--- trunk/Source/WebKit/WebProcess/WebProcess.cpp	2018-05-03 16:01:26 UTC (rev 231306)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp	2018-05-03 16:31:53 UTC (rev 231307)
@@ -224,23 +224,6 @@
 
     MessagePortChannelProvider::setSharedProvider(WebMessagePortChannelProvider::singleton());
     
-#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);
 }
 

Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (231306 => 231307)


--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2018-05-03 16:01:26 UTC (rev 231306)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2018-05-03 16:31:53 UTC (rev 231307)
@@ -298,6 +298,20 @@
 
 void WebProcess::platformInitializeProcess(const ChildProcessInitializationParameters&)
 {
+#if PLATFORM(MAC)
+#if ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
+    // Deny the WebContent process access to the WindowServer.
+    // This call will not succeed if there are open WindowServer connections at this point.
+    setApplicationIsDaemon();
+#else
+#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 // __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#endif // ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
+#endif // PLATFORM(MAC)
+
     registerWithAccessibility();
 
 #if USE(OS_STATE)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to