Title: [236075] trunk/Source/WebKit
Revision
236075
Author
[email protected]
Date
2018-09-17 11:45:46 -0700 (Mon, 17 Sep 2018)

Log Message

Expose XPCServiceMain in a WebProcess header rather than WKProcessPool
https://bugs.webkit.org/show_bug.cgi?id=189636

Patch by Alex Christensen <[email protected]> on 2018-09-17
Reviewed by Dan Bernstein.

Fix a few build failures along the way.

* PluginProcess/mac/PluginControllerProxyMac.mm:
(WebKit::PluginControllerProxy::windowAndViewFramesChanged):
(WebKit::PluginControllerProxy::updateLayerHostingContext):
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::replacedNSWorkspace_launchApplicationAtURL_options_configuration_error):
(WebKit::PluginProcess::platformInitializeProcess):
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
(WebKit::XPCServiceMain):
(main):
* SourcesCocoa.txt:
* UIProcess/API/Cocoa/WKProcessPool.mm:
(+[WKProcessPool _webContentProcessXPCMain]): Deleted.
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/API: Added.
* WebProcess/API/Cocoa: Added.
* WebProcess/API/Cocoa/WKWebProcess.cpp: Added.
(WKWebProcessMain):
* WebProcess/API/Cocoa/WKWebProcess.h: Added.
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject convertScreenPointToRootView:]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
(-[WKAccessibilityWebPageObject accessibilityHitTest:]):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (236074 => 236075)


--- trunk/Source/WebKit/ChangeLog	2018-09-17 18:24:10 UTC (rev 236074)
+++ trunk/Source/WebKit/ChangeLog	2018-09-17 18:45:46 UTC (rev 236075)
@@ -1,3 +1,37 @@
+2018-09-17  Alex Christensen  <[email protected]>
+
+        Expose XPCServiceMain in a WebProcess header rather than WKProcessPool
+        https://bugs.webkit.org/show_bug.cgi?id=189636
+
+        Reviewed by Dan Bernstein.
+
+        Fix a few build failures along the way.
+
+        * PluginProcess/mac/PluginControllerProxyMac.mm:
+        (WebKit::PluginControllerProxy::windowAndViewFramesChanged):
+        (WebKit::PluginControllerProxy::updateLayerHostingContext):
+        * PluginProcess/mac/PluginProcessMac.mm:
+        (WebKit::replacedNSWorkspace_launchApplicationAtURL_options_configuration_error):
+        (WebKit::PluginProcess::platformInitializeProcess):
+        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
+        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
+        (WebKit::XPCServiceMain):
+        (main):
+        * SourcesCocoa.txt:
+        * UIProcess/API/Cocoa/WKProcessPool.mm:
+        (+[WKProcessPool _webContentProcessXPCMain]): Deleted.
+        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebProcess/API: Added.
+        * WebProcess/API/Cocoa: Added.
+        * WebProcess/API/Cocoa/WKWebProcess.cpp: Added.
+        (WKWebProcessMain):
+        * WebProcess/API/Cocoa/WKWebProcess.h: Added.
+        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
+        (-[WKAccessibilityWebPageObject convertScreenPointToRootView:]):
+        (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
+        (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
+
 2018-09-17  Basuke Suzuki  <[email protected]>
 
         [Curl] Respond with requested authentication scheme for authentication challenge.

Modified: trunk/Source/WebKit/PluginProcess/mac/PluginControllerProxyMac.mm (236074 => 236075)


--- trunk/Source/WebKit/PluginProcess/mac/PluginControllerProxyMac.mm	2018-09-17 18:24:10 UTC (rev 236074)
+++ trunk/Source/WebKit/PluginProcess/mac/PluginControllerProxyMac.mm	2018-09-17 18:45:46 UTC (rev 236075)
@@ -37,8 +37,6 @@
 #import <QuartzCore/QuartzCore.h>
 #import <WebCore/GraphicsContextCG.h>
 
-using namespace WebCore;
-
 namespace WebKit {
 
 void PluginControllerProxy::pluginFocusOrWindowFocusChanged(bool pluginHasFocusAndWindowHasFocus)
@@ -90,7 +88,7 @@
     [CATransaction commit];
 }
 
-void PluginControllerProxy::windowAndViewFramesChanged(const IntRect& windowFrameInScreenCoordinates, const IntRect& viewFrameInWindowCoordinates)
+void PluginControllerProxy::windowAndViewFramesChanged(const WebCore::IntRect& windowFrameInScreenCoordinates, const WebCore::IntRect& viewFrameInWindowCoordinates)
 {
     m_plugin->windowAndViewFramesChanged(windowFrameInScreenCoordinates, viewFrameInWindowCoordinates);
 }
@@ -135,7 +133,7 @@
 #endif
     }
 
-    m_layerHostingContext->setColorSpace(sRGBColorSpaceRef());
+    m_layerHostingContext->setColorSpace(WebCore::sRGBColorSpaceRef());
     m_layerHostingContext->setColorMatchUntaggedContent(true);
 
     m_layerHostingContext->setRootLayer(platformLayer);

Modified: trunk/Source/WebKit/PluginProcess/mac/PluginProcessMac.mm (236074 => 236075)


--- trunk/Source/WebKit/PluginProcess/mac/PluginProcessMac.mm	2018-09-17 18:24:10 UTC (rev 236074)
+++ trunk/Source/WebKit/PluginProcess/mac/PluginProcessMac.mm	2018-09-17 18:45:46 UTC (rev 236075)
@@ -56,8 +56,6 @@
 #import <wtf/HashSet.h>
 #import <wtf/NeverDestroyed.h>
 
-using namespace WebCore;
-
 const CFStringRef kLSPlugInBundleIdentifierKey = CFSTR("LSPlugInBundleIdentifierKey");
 
 // These values were chosen to match default NSURLCache sizes at the time of this writing.
@@ -217,11 +215,11 @@
 static bool openCFURLRef(CFURLRef url, int32_t& status, CFURLRef* launchedURL)
 {
     String launchedURLString;
-    if (!PluginProcess::singleton().openURL(URL(url).string(), status, launchedURLString))
+    if (!PluginProcess::singleton().openURL(WebCore::URL(url).string(), status, launchedURLString))
         return false;
 
     if (!launchedURLString.isNull() && launchedURL)
-        *launchedURL = URL(ParsedURLString, launchedURLString).createCFURL().leakRef();
+        *launchedURL = WebCore::URL(WebCore::URL(), launchedURLString).createCFURL().leakRef();
     return true;
 }
 
@@ -401,7 +399,7 @@
         }
     }
 
-    if (PluginProcess::singleton().launchApplicationAtURL(URL(url).string(), arguments)) {
+    if (PluginProcess::singleton().launchApplicationAtURL(WebCore::URL(url).string(), arguments)) {
         if (error)
             *error = nil;
         return nil;
@@ -534,7 +532,7 @@
     initializeCocoaOverrides();
 
     bool experimentalPlugInSandboxProfilesEnabled = parameters.extraInitializationData.get("experimental-sandbox-plugin") == "1";
-    RuntimeEnabledFeatures::sharedFeatures().setExperimentalPlugInSandboxProfilesEnabled(experimentalPlugInSandboxProfilesEnabled);
+    WebCore::RuntimeEnabledFeatures::sharedFeatures().setExperimentalPlugInSandboxProfilesEnabled(experimentalPlugInSandboxProfilesEnabled);
 
     // FIXME: It would be better to proxy SetCursor calls over to the UI process instead of
     // allowing plug-ins to change the mouse cursor at any time.

Modified: trunk/Source/WebKit/Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h (236074 => 236075)


--- trunk/Source/WebKit/Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h	2018-09-17 18:24:10 UTC (rev 236074)
+++ trunk/Source/WebKit/Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h	2018-09-17 18:45:46 UTC (rev 236075)
@@ -117,7 +117,7 @@
     XPCServiceType::singleton().initialize(parameters);
 }
 
-int XPCServiceMain();
+int XPCServiceMain(int, const char**);
 
 void XPCServiceExit(OSObjectPtr<xpc_object_t>&& priorityBoostMessage);
 

Modified: trunk/Source/WebKit/Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm (236074 => 236075)


--- trunk/Source/WebKit/Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm	2018-09-17 18:24:10 UTC (rev 236074)
+++ trunk/Source/WebKit/Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm	2018-09-17 18:45:46 UTC (rev 236075)
@@ -92,7 +92,7 @@
     xpc_connection_resume(peer);
 }
 
-int XPCServiceMain()
+int XPCServiceMain(int, const char**)
 {
 #if defined(__i386__)
     // FIXME: This should only be done for the 32-bit plug-in XPC service so we rely on the fact that
@@ -160,7 +160,7 @@
 
 } // namespace WebKit
 
-int main(int argc, char** argv)
+int main(int argc, const char** argv)
 {
-    return WebKit::XPCServiceMain();
+    return WebKit::XPCServiceMain(argc, argv);
 }

Modified: trunk/Source/WebKit/SourcesCocoa.txt (236074 => 236075)


--- trunk/Source/WebKit/SourcesCocoa.txt	2018-09-17 18:24:10 UTC (rev 236074)
+++ trunk/Source/WebKit/SourcesCocoa.txt	2018-09-17 18:45:46 UTC (rev 236075)
@@ -463,6 +463,8 @@
 
 UIProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm
 
+WebProcess/API/Cocoa/WKWebProcess.cpp
+
 WebProcess/ApplePay/WebPaymentCoordinator.cpp
 
 WebProcess/cocoa/PlaybackSessionManager.mm

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm (236074 => 236075)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm	2018-09-17 18:24:10 UTC (rev 236074)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm	2018-09-17 18:45:46 UTC (rev 236075)
@@ -40,7 +40,6 @@
 #import "WebCookieManagerProxy.h"
 #import "WebProcessMessages.h"
 #import "WebProcessPool.h"
-#import "XPCServiceEntryPoint.h"
 #import "_WKAutomationDelegate.h"
 #import "_WKAutomationSessionInternal.h"
 #import "_WKDownloadDelegate.h"
@@ -182,11 +181,6 @@
     return [url URLByAppendingPathComponent:@"WebsiteData" isDirectory:YES];
 }
 
-+ (int)_webContentProcessXPCMain
-{
-    return WebKit::XPCServiceMain();
-}
-
 - (void)_setAllowsSpecificHTTPSCertificate:(NSArray *)certificateChain forHost:(NSString *)host
 {
     _processPool->allowSpecificHTTPSCertificateForHost(WebKit::WebCertificateInfo::create(WebCore::CertificateInfo((__bridge CFArrayRef)certificateChain)).ptr(), host);

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h (236074 => 236075)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h	2018-09-17 18:24:10 UTC (rev 236074)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h	2018-09-17 18:45:46 UTC (rev 236075)
@@ -79,8 +79,6 @@
 
 - (void)_registerURLSchemeAsCanDisplayOnlyIfCanRequest:(NSString *)scheme WK_API_AVAILABLE(macosx(10.14), ios(12.0));
 
-+ (int)_webContentProcessXPCMain WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
-
 // Test only. Should be called only while no web content processes are running.
 - (void)_terminateStorageProcess;
 - (void)_terminateNetworkProcess;

Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (236074 => 236075)


--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2018-09-17 18:24:10 UTC (rev 236074)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2018-09-17 18:45:46 UTC (rev 236075)
@@ -3427,6 +3427,8 @@
 		5C62FDF81EFC263C00CE072E /* WKURLSchemeTaskPrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKURLSchemeTaskPrivate.h; sourceTree = "<group>"; };
 		5C6CE6D01F59BC460007C6CB /* PageClientImplCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PageClientImplCocoa.mm; sourceTree = "<group>"; };
 		5C6CE6D31F59EA350007C6CB /* PageClientImplCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageClientImplCocoa.h; sourceTree = "<group>"; };
+		5C74300E21500492004BFA17 /* WKWebProcess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebProcess.h; sourceTree = "<group>"; };
+		5C74300F21500492004BFA17 /* WKWebProcess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKWebProcess.cpp; sourceTree = "<group>"; };
 		5C7706731D111D8B0012700F /* WebSocketProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebSocketProvider.cpp; path = Network/WebSocketProvider.cpp; sourceTree = "<group>"; };
 		5C7C88DC1D0F41A0009D2F6D /* WebSocketProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebSocketProvider.h; path = Network/WebSocketProvider.h; sourceTree = "<group>"; };
 		5C84CF901F96AC4E00B6705A /* NetworkSessionCreationParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkSessionCreationParameters.h; sourceTree = "<group>"; };
@@ -6814,6 +6816,23 @@
 			path = Cocoa;
 			sourceTree = "<group>";
 		};
+		5C74300C21500434004BFA17 /* API */ = {
+			isa = PBXGroup;
+			children = (
+				5C74300D21500442004BFA17 /* Cocoa */,
+			);
+			path = API;
+			sourceTree = "<group>";
+		};
+		5C74300D21500442004BFA17 /* Cocoa */ = {
+			isa = PBXGroup;
+			children = (
+				5C74300F21500492004BFA17 /* WKWebProcess.cpp */,
+				5C74300E21500492004BFA17 /* WKWebProcess.h */,
+			);
+			path = Cocoa;
+			sourceTree = "<group>";
+		};
 		6BE969BF1E54D452008B7483 /* ResourceLoadStatistics */ = {
 			isa = PBXGroup;
 			children = (
@@ -7061,6 +7080,7 @@
 		BC032D5C10F436D50058C15A /* WebProcess */ = {
 			isa = PBXGroup;
 			children = (
+				5C74300C21500434004BFA17 /* API */,
 				1AB1F7701D1B2F5D007C9BD1 /* ApplePay */,
 				1C0A19431C8FF1A800FE0EBB /* Automation */,
 				41D129D81F3D101400D15E47 /* Cache */,

Added: trunk/Source/WebKit/WebProcess/API/Cocoa/WKWebProcess.cpp (0 => 236075)


--- trunk/Source/WebKit/WebProcess/API/Cocoa/WKWebProcess.cpp	                        (rev 0)
+++ trunk/Source/WebKit/WebProcess/API/Cocoa/WKWebProcess.cpp	2018-09-17 18:45:46 UTC (rev 236075)
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKWebProcess.h"
+
+#include "XPCServiceEntryPoint.h"
+
+int WKWebProcessMain(int argc, const char** argv)
+{
+    return WebKit::XPCServiceMain(argc, argv);
+}

Added: trunk/Source/WebKit/WebProcess/API/Cocoa/WKWebProcess.h (0 => 236075)


--- trunk/Source/WebKit/WebProcess/API/Cocoa/WKWebProcess.h	                        (rev 0)
+++ trunk/Source/WebKit/WebProcess/API/Cocoa/WKWebProcess.h	2018-09-17 18:45:46 UTC (rev 236075)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <WebKit/WKFoundation.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT int WKWebProcessMain(int argc, const char** argv) WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
+
+#ifdef __cplusplus
+}
+#endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to