Title: [230689] trunk/Source
Revision
230689
Author
bfulg...@apple.com
Date
2018-04-16 16:43:05 -0700 (Mon, 16 Apr 2018)

Log Message

[macOS] Don't establish unneeded Dock connections
https://bugs.webkit.org/show_bug.cgi?id=184664
<rdar://problem/16863698>

Reviewed by Simon Fraser.

There is no reason for the WebContent or Plugin processes to interact with
the Dock. We should tell AppKit that we don't want this connection, and to
avoid creating such connections.

Source/WebCore/PAL:

* pal/spi/mac/NSApplicationSPI.h: Add Dock connection declaration.

Source/WebKit:

* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::PluginProcess::platformInitializeProcess): Tell NSApplication to
not create a Dock connection.
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess): Ditto.

Modified Paths

Diff

Modified: trunk/Source/WebCore/PAL/ChangeLog (230688 => 230689)


--- trunk/Source/WebCore/PAL/ChangeLog	2018-04-16 23:18:45 UTC (rev 230688)
+++ trunk/Source/WebCore/PAL/ChangeLog	2018-04-16 23:43:05 UTC (rev 230689)
@@ -1,3 +1,17 @@
+2018-04-16  Brent Fulgham  <bfulg...@apple.com>
+
+        [macOS] Don't establish unneeded Dock connections
+        https://bugs.webkit.org/show_bug.cgi?id=184664
+        <rdar://problem/16863698>
+
+        Reviewed by Simon Fraser.
+
+        There is no reason for the WebContent or Plugin processes to interact with
+        the Dock. We should tell AppKit that we don't want this connection, and to
+        avoid creating such connections.
+
+        * pal/spi/mac/NSApplicationSPI.h: Add Dock connection declaration.
+
 2018-04-09  John Wilander  <wilan...@apple.com>
 
         Refactor Ignore HSTS code

Modified: trunk/Source/WebCore/PAL/pal/spi/mac/NSApplicationSPI.h (230688 => 230689)


--- trunk/Source/WebCore/PAL/pal/spi/mac/NSApplicationSPI.h	2018-04-16 23:18:45 UTC (rev 230688)
+++ trunk/Source/WebCore/PAL/pal/spi/mac/NSApplicationSPI.h	2018-04-16 23:43:05 UTC (rev 230689)
@@ -32,6 +32,7 @@
 
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
 + (void)_accessibilityInitialize;
++ (void)_preventDockConnections;
 #endif
 
 @end

Modified: trunk/Source/WebKit/ChangeLog (230688 => 230689)


--- trunk/Source/WebKit/ChangeLog	2018-04-16 23:18:45 UTC (rev 230688)
+++ trunk/Source/WebKit/ChangeLog	2018-04-16 23:43:05 UTC (rev 230689)
@@ -1,3 +1,21 @@
+2018-04-16  Brent Fulgham  <bfulg...@apple.com>
+
+        [macOS] Don't establish unneeded Dock connections
+        https://bugs.webkit.org/show_bug.cgi?id=184664
+        <rdar://problem/16863698>
+
+        Reviewed by Simon Fraser.
+
+        There is no reason for the WebContent or Plugin processes to interact with
+        the Dock. We should tell AppKit that we don't want this connection, and to
+        avoid creating such connections.
+
+        * PluginProcess/mac/PluginProcessMac.mm:
+        (WebKit::PluginProcess::platformInitializeProcess): Tell NSApplication to
+        not create a Dock connection.
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::WebProcess::platformInitializeWebProcess): Ditto.
+
 2018-04-16  Megan Gardner  <megan_gard...@apple.com>
 
         Switch to UIWKTextInteractionAssistant for non-editable text

Modified: trunk/Source/WebKit/PluginProcess/mac/PluginProcessMac.mm (230688 => 230689)


--- trunk/Source/WebKit/PluginProcess/mac/PluginProcessMac.mm	2018-04-16 23:18:45 UTC (rev 230688)
+++ trunk/Source/WebKit/PluginProcess/mac/PluginProcessMac.mm	2018-04-16 23:43:05 UTC (rev 230689)
@@ -48,6 +48,7 @@
 #import <pal/spi/cg/CoreGraphicsSPI.h>
 #import <pal/spi/cocoa/LaunchServicesSPI.h>
 #import <pal/spi/mac/HIToolboxSPI.h>
+#import <pal/spi/mac/NSApplicationSPI.h>
 #import <pal/spi/mac/NSWindowSPI.h>
 #import <sysexits.h>
 #import <wtf/HashSet.h>
@@ -524,6 +525,12 @@
 {
     initializeShim();
 
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+    // We don't need to talk to the dock.
+    if ([NSApplication respondsToSelector:@selector(_preventDockConnections)])
+        [NSApplication _preventDockConnections];
+#endif
+
     initializeCocoaOverrides();
 
     // FIXME: It would be better to proxy SetCursor calls over to the UI process instead of

Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (230688 => 230689)


--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2018-04-16 23:18:45 UTC (rev 230688)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2018-04-16 23:43:05 UTC (rev 230689)
@@ -170,6 +170,10 @@
 #endif
     
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+    // We don't need to talk to the dock.
+    if ([NSApplication respondsToSelector:@selector(_preventDockConnections)])
+        [NSApplication _preventDockConnections];
+
     // Need to initialize accessibility for VoiceOver to work when the WebContent process is using NSRunLoop.
     // Currently, it is also needed to allocate and initialize an NSApplication object.
     // FIXME: Remove the following line when rdar://problem/36323569 is fixed.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to