Shutdown WindowServer connections after checking in with launch services
authorpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 May 2018 23:42:44 +0000 (23:42 +0000)
committerpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 May 2018 23:42:44 +0000 (23:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=185082
<rdar://problem/39613173>

Reviewed by Brent Fulgham.

When WindowServer access is blocked in the WebContent process, we should shutdown all connections
after checking in with launch services.

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

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

Source/WebKit/ChangeLog
Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm

index dff61eb..8a807ea 100644 (file)
@@ -1,3 +1,17 @@
+2018-05-04  Per Arne Vollan  <pvollan@apple.com>
+
+        Shutdown WindowServer connections after checking in with launch services
+        https://bugs.webkit.org/show_bug.cgi?id=185082
+        <rdar://problem/39613173>
+
+        Reviewed by Brent Fulgham.
+
+        When WindowServer access is blocked in the WebContent process, we should shutdown all connections
+        after checking in with launch services.
+
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::WebProcess::platformInitializeProcess):
+
 2018-05-04  Don Olmstead  <don.olmstead@sony.com>
 
         [Win][WebKit] Fix forwarding headers for Windows build
index bc7db23..6a585a1 100644 (file)
@@ -303,6 +303,8 @@ void WebProcess::platformInitializeProcess(const ChildProcessInitializationParam
     // Deny the WebContent process access to the WindowServer.
     // This call will not succeed if there are open WindowServer connections at this point.
     setApplicationIsDaemon();
+    // Make sure that we close any WindowServer connections after checking in with Launch Services.
+    CGSShutdownServerConnections();
 #else
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
     // This call is needed when the WebProcess is not running the NSApplication event loop.