Title: [233769] trunk/Source
Revision
233769
Author
pvol...@apple.com
Date
2018-07-12 09:02:10 -0700 (Thu, 12 Jul 2018)

Log Message

Add compile guard for enabling NSRunLoop in the WebContent process.
https://bugs.webkit.org/show_bug.cgi?id=187563

Reviewed by Chris Dumez.

Source/WebCore:

No new tests, no change in behavior.

* platform/mac/EventLoopMac.mm:
(WebCore::EventLoop::cycle):

Source/WebKit:

Also, replace __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 with ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) where appropriate.

* Platform/mac/LayerHostingContext.mm:
(WebKit::LayerHostingContext::createForExternalHostingProcess):
* Shared/ChildProcess.h:
* Shared/mac/ChildProcessMac.mm:
* Shared/mac/HangDetectionDisablerMac.mm:
(WebKit::setClientsMayIgnoreEvents):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::registerNotificationObservers):
(WebKit::WebProcessPool::unregisterNotificationObservers):
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::shouldLeakBoost):
* UIProcess/WebProcessPool.h:
* WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::PDFPlugin):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
(WebKit::WebProcess::stopRunLoop):

Source/WTF:

* wtf/FeatureDefines.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (233768 => 233769)


--- trunk/Source/WTF/ChangeLog	2018-07-12 14:35:38 UTC (rev 233768)
+++ trunk/Source/WTF/ChangeLog	2018-07-12 16:02:10 UTC (rev 233769)
@@ -1,3 +1,12 @@
+2018-07-12  Per Arne Vollan  <pvol...@apple.com>
+
+        Add compile guard for enabling NSRunLoop in the WebContent process.
+        https://bugs.webkit.org/show_bug.cgi?id=187563
+
+        Reviewed by Chris Dumez.
+
+        * wtf/FeatureDefines.h:
+
 2018-07-09  Zan Dobersek  <zdober...@igalia.com>
 
         Unreviewed follow-up to r233660.

Modified: trunk/Source/WTF/wtf/FeatureDefines.h (233768 => 233769)


--- trunk/Source/WTF/wtf/FeatureDefines.h	2018-07-12 14:35:38 UTC (rev 233768)
+++ trunk/Source/WTF/wtf/FeatureDefines.h	2018-07-12 16:02:10 UTC (rev 233769)
@@ -237,8 +237,12 @@
 #define ENABLE_MAC_GESTURE_EVENTS 1
 #endif
 
+#if !defined(ENABLE_WEBPROCESS_NSRUNLOOP)
+#define ENABLE_WEBPROCESS_NSRUNLOOP __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#endif
+
 #if !defined(ENABLE_WEBPROCESS_WINDOWSERVER_BLOCKING)
-#define ENABLE_WEBPROCESS_WINDOWSERVER_BLOCKING __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#define ENABLE_WEBPROCESS_WINDOWSERVER_BLOCKING ENABLE_WEBPROCESS_NSRUNLOOP
 #endif
 
 #endif /* PLATFORM(MAC) */

Modified: trunk/Source/WebCore/ChangeLog (233768 => 233769)


--- trunk/Source/WebCore/ChangeLog	2018-07-12 14:35:38 UTC (rev 233768)
+++ trunk/Source/WebCore/ChangeLog	2018-07-12 16:02:10 UTC (rev 233769)
@@ -1,3 +1,15 @@
+2018-07-12  Per Arne Vollan  <pvol...@apple.com>
+
+        Add compile guard for enabling NSRunLoop in the WebContent process.
+        https://bugs.webkit.org/show_bug.cgi?id=187563
+
+        Reviewed by Chris Dumez.
+
+        No new tests, no change in behavior.
+
+        * platform/mac/EventLoopMac.mm:
+        (WebCore::EventLoop::cycle):
+
 2018-07-12  Zalan Bujtas  <za...@apple.com>
 
         Newly added float should trigger full layout on the block.

Modified: trunk/Source/WebCore/platform/mac/EventLoopMac.mm (233768 => 233769)


--- trunk/Source/WebCore/platform/mac/EventLoopMac.mm	2018-07-12 14:35:38 UTC (rev 233768)
+++ trunk/Source/WebCore/platform/mac/EventLoopMac.mm	2018-07-12 16:02:10 UTC (rev 233769)
@@ -34,7 +34,7 @@
 
 void EventLoop::cycle()
 {
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if ENABLE(WEBPROCESS_NSRUNLOOP)
     if (![NSApp isRunning]) {
         [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.05]];
         return;

Modified: trunk/Source/WebKit/ChangeLog (233768 => 233769)


--- trunk/Source/WebKit/ChangeLog	2018-07-12 14:35:38 UTC (rev 233768)
+++ trunk/Source/WebKit/ChangeLog	2018-07-12 16:02:10 UTC (rev 233769)
@@ -1,3 +1,33 @@
+2018-07-12  Per Arne Vollan  <pvol...@apple.com>
+
+        Add compile guard for enabling NSRunLoop in the WebContent process.
+        https://bugs.webkit.org/show_bug.cgi?id=187563
+
+        Reviewed by Chris Dumez.
+
+        Also, replace __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 with ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) where appropriate.
+
+        * Platform/mac/LayerHostingContext.mm:
+        (WebKit::LayerHostingContext::createForExternalHostingProcess):
+        * Shared/ChildProcess.h:
+        * Shared/mac/ChildProcessMac.mm:
+        * Shared/mac/HangDetectionDisablerMac.mm:
+        (WebKit::setClientsMayIgnoreEvents):
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::WebProcessPool::registerNotificationObservers):
+        (WebKit::WebProcessPool::unregisterNotificationObservers):
+        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
+        (WebKit::shouldLeakBoost):
+        * UIProcess/WebProcessPool.h:
+        * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
+        * WebProcess/Plugins/PDF/PDFPlugin.mm:
+        (WebKit::PDFPlugin::PDFPlugin):
+        * WebProcess/WebProcess.h:
+        * WebProcess/WebProcess.messages.in:
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::WebProcess::platformInitializeWebProcess):
+        (WebKit::WebProcess::stopRunLoop):
+
 2018-07-11  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [WPE] Pass the backend library name as command line parameter to the web process

Modified: trunk/Source/WebKit/Platform/mac/LayerHostingContext.mm (233768 => 233769)


--- trunk/Source/WebKit/Platform/mac/LayerHostingContext.mm	2018-07-12 14:35:38 UTC (rev 233768)
+++ trunk/Source/WebKit/Platform/mac/LayerHostingContext.mm	2018-07-12 16:02:10 UTC (rev 233769)
@@ -64,7 +64,7 @@
         kCAContextDisplayId : @10000
 #endif
     }];
-#elif !PLATFORM(IOSMAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#elif !PLATFORM(IOSMAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
     [CAContext setAllowsCGSConnections:NO];
     layerHostingContext->m_context = [CAContext remoteContextWithOptions:@{kCAContextCIFilterBehavior :  @"ignore"}];
 #else

Modified: trunk/Source/WebKit/Shared/ChildProcess.h (233768 => 233769)


--- trunk/Source/WebKit/Shared/ChildProcess.h	2018-07-12 14:35:38 UTC (rev 233768)
+++ trunk/Source/WebKit/Shared/ChildProcess.h	2018-07-12 16:02:10 UTC (rev 233769)
@@ -100,7 +100,7 @@
     static void stopNSAppRunLoop();
 #endif
     
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if PLATFORM(MAC) && ENABLE(WEBPROCESS_NSRUNLOOP)
     static void stopNSRunLoop();
 #endif
 

Modified: trunk/Source/WebKit/Shared/mac/ChildProcessMac.mm (233768 => 233769)


--- trunk/Source/WebKit/Shared/mac/ChildProcessMac.mm	2018-07-12 14:35:38 UTC (rev 233768)
+++ trunk/Source/WebKit/Shared/mac/ChildProcessMac.mm	2018-07-12 16:02:10 UTC (rev 233769)
@@ -234,7 +234,7 @@
 }
 #endif
 
-#if !PLATFORM(IOSMAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if !PLATFORM(IOSMAC) && ENABLE(WEBPROCESS_NSRUNLOOP)
 void ChildProcess::stopNSRunLoop()
 {
     ASSERT([NSRunLoop mainRunLoop]);

Modified: trunk/Source/WebKit/Shared/mac/HangDetectionDisablerMac.mm (233768 => 233769)


--- trunk/Source/WebKit/Shared/mac/HangDetectionDisablerMac.mm	2018-07-12 14:35:38 UTC (rev 233768)
+++ trunk/Source/WebKit/Shared/mac/HangDetectionDisablerMac.mm	2018-07-12 16:02:10 UTC (rev 233769)
@@ -48,7 +48,7 @@
 static void setClientsMayIgnoreEvents(bool clientsMayIgnoreEvents)
 {
     auto cgsId = CGSMainConnectionID();
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
     // In macOS 10.14 and later, the WebContent process does not have access to the WindowServer.
     // In this case, there will be no valid WindowServer main connection.
     if (!cgsId)

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (233768 => 233769)


--- trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2018-07-12 14:35:38 UTC (rev 233768)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2018-07-12 16:02:10 UTC (rev 233769)
@@ -558,7 +558,7 @@
         screenPropertiesStateChanged();
     }];
 
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
     m_scrollerStyleNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSPreferredScrollerStyleDidChangeNotification object:nil queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *notification) {
         auto scrollbarStyle = [NSScroller preferredScrollerStyle];
         sendToAllProcesses(Messages::WebProcess::ScrollerStylePreferenceChanged(scrollbarStyle));
@@ -577,7 +577,7 @@
     [[NSNotificationCenter defaultCenter] removeObserver:m_automaticQuoteSubstitutionNotificationObserver.get()];
     [[NSNotificationCenter defaultCenter] removeObserver:m_automaticDashSubstitutionNotificationObserver.get()];
     [[NSWorkspace.sharedWorkspace notificationCenter] removeObserver:m_accessibilityDisplayOptionsNotificationObserver.get()];
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
     [[NSNotificationCenter defaultCenter] removeObserver:m_scrollerStyleNotificationObserver.get()];
 #endif
 #endif // !PLATFORM(IOS)

Modified: trunk/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm (233768 => 233769)


--- trunk/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm	2018-07-12 14:35:38 UTC (rev 233768)
+++ trunk/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm	2018-07-12 16:02:10 UTC (rev 233769)
@@ -78,7 +78,7 @@
     UNUSED_PARAM(launchOptions);
     return true;
 #else
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if ENABLE(WEBPROCESS_NSRUNLOOP)
     // Boost the WebContent process if the NSApplication run loop is not used.
     if (launchOptions.processType == ProcessLauncher::ProcessType::Web)
         return true;

Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.h (233768 => 233769)


--- trunk/Source/WebKit/UIProcess/WebProcessPool.h	2018-07-12 14:35:38 UTC (rev 233768)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.h	2018-07-12 16:02:10 UTC (rev 233769)
@@ -615,7 +615,7 @@
     RetainPtr<NSObject> m_automaticQuoteSubstitutionNotificationObserver;
     RetainPtr<NSObject> m_automaticDashSubstitutionNotificationObserver;
     RetainPtr<NSObject> m_accessibilityDisplayOptionsNotificationObserver;
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
     RetainPtr<NSObject> m_scrollerStyleNotificationObserver;
 #endif
 

Modified: trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFLayerControllerSPI.h (233768 => 233769)


--- trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFLayerControllerSPI.h	2018-07-12 14:35:38 UTC (rev 233768)
+++ trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFLayerControllerSPI.h	2018-07-12 16:02:10 UTC (rev 233769)
@@ -166,7 +166,7 @@
 - (id)accessibilityElementForAnnotation:(PDFAnnotation *)annotation;
 #endif
 
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
 - (void)setDeviceColorSpace:(CGColorSpaceRef)colorSpace;
 #endif
 @end

Modified: trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm (233768 => 233769)


--- trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm	2018-07-12 14:35:38 UTC (rev 233768)
+++ trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm	2018-07-12 16:02:10 UTC (rev 233769)
@@ -637,7 +637,7 @@
 
     [m_containerLayer addSublayer:m_contentLayer.get()];
     [m_containerLayer addSublayer:m_scrollCornerLayer.get()];
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
     if ([m_pdfLayerController respondsToSelector:@selector(setDeviceColorSpace:)]) {
         auto view = webFrame()->coreFrame()->view();
         [m_pdfLayerController setDeviceColorSpace:screenColorSpace(view)];

Modified: trunk/Source/WebKit/WebProcess/WebProcess.h (233768 => 233769)


--- trunk/Source/WebKit/WebProcess/WebProcess.h	2018-07-12 14:35:38 UTC (rev 233768)
+++ trunk/Source/WebKit/WebProcess/WebProcess.h	2018-07-12 16:02:10 UTC (rev 233769)
@@ -380,7 +380,7 @@
 
 #if PLATFORM(MAC)
     void setScreenProperties(const WebCore::ScreenProperties&);
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
     void scrollerStylePreferenceChanged(bool useOverlayScrollbars);
 #endif
 #endif

Modified: trunk/Source/WebKit/WebProcess/WebProcess.messages.in (233768 => 233769)


--- trunk/Source/WebKit/WebProcess/WebProcess.messages.in	2018-07-12 14:35:38 UTC (rev 233768)
+++ trunk/Source/WebKit/WebProcess/WebProcess.messages.in	2018-07-12 16:02:10 UTC (rev 233769)
@@ -131,7 +131,7 @@
 
 #if PLATFORM(MAC)
     SetScreenProperties(struct WebCore::ScreenProperties screenProperties)
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
     ScrollerStylePreferenceChanged(bool useOvelayScrollbars)
 #endif
 #endif

Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (233768 => 233769)


--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2018-07-12 14:35:38 UTC (rev 233768)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2018-07-12 16:02:10 UTC (rev 233769)
@@ -171,7 +171,7 @@
     method_setImplementation(methodToPatch, (IMP)NSApplicationAccessibilityFocusedUIElement);
 #endif
     
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if PLATFORM(MAC) && ENABLE(WEBPROCESS_NSRUNLOOP)
     // 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.
@@ -338,7 +338,7 @@
 #if USE(APPKIT)
 void WebProcess::stopRunLoop()
 {
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if PLATFORM(MAC) && ENABLE(WEBPROCESS_NSRUNLOOP)
     ChildProcess::stopNSRunLoop();
 #else
     ChildProcess::stopNSAppRunLoop();
@@ -579,7 +579,7 @@
 }
 #endif
 
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
 void WebProcess::scrollerStylePreferenceChanged(bool useOverlayScrollbars)
 {
     ScrollerStyle::setUseOverlayScrollbars(useOverlayScrollbars);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to