Expose XPCServiceMain in a WebProcess header rather than WKProcessPool
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Sep 2018 18:45:46 +0000 (18:45 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Sep 2018 18:45:46 +0000 (18:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189636

Patch by Alex Christensen <achristensen@webkit.org> 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:]):

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

Source/WebKit/ChangeLog
Source/WebKit/PluginProcess/mac/PluginControllerProxyMac.mm
Source/WebKit/PluginProcess/mac/PluginProcessMac.mm
Source/WebKit/Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h
Source/WebKit/Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm
Source/WebKit/SourcesCocoa.txt
Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm
Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Source/WebKit/WebProcess/API/Cocoa/WKWebProcess.cpp [new file with mode: 0644]
Source/WebKit/WebProcess/API/Cocoa/WKWebProcess.h [new file with mode: 0644]

index 59d20db..8843c2b 100644 (file)
@@ -1,3 +1,37 @@
+2018-09-17  Alex Christensen  <achristensen@webkit.org>
+
+        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  <Basuke.Suzuki@sony.com>
 
         [Curl] Respond with requested authentication scheme for authentication challenge.
index 1fdc040..5680b90 100644 (file)
@@ -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 @@ void PluginControllerProxy::platformGeometryDidChange()
     [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 @@ void PluginControllerProxy::updateLayerHostingContext(LayerHostingMode layerHost
 #endif
     }
 
-    m_layerHostingContext->setColorSpace(sRGBColorSpaceRef());
+    m_layerHostingContext->setColorSpace(WebCore::sRGBColorSpaceRef());
     m_layerHostingContext->setColorMatchUntaggedContent(true);
 
     m_layerHostingContext->setRootLayer(platformLayer);
index 6ee5d48..402ec1d 100644 (file)
@@ -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 void carbonWindowHidden(WindowRef window)
 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 @@ static NSRunningApplication *replacedNSWorkspace_launchApplicationAtURL_options_
         }
     }
 
-    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 @@ void PluginProcess::platformInitializeProcess(const ChildProcessInitializationPa
     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.
index f7ccbe2..87925ca 100644 (file)
@@ -117,7 +117,7 @@ void XPCServiceInitializer(OSObjectPtr<xpc_connection_t> connection, xpc_object_
     XPCServiceType::singleton().initialize(parameters);
 }
 
-int XPCServiceMain();
+int XPCServiceMain(int, const char**);
 
 void XPCServiceExit(OSObjectPtr<xpc_object_t>&& priorityBoostMessage);
 
index 3d5d369..1d01b8a 100644 (file)
@@ -92,7 +92,7 @@ static void XPCServiceEventHandler(xpc_connection_t peer)
     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 @@ int XPCServiceMain()
 
 } // namespace WebKit
 
-int main(int argc, char** argv)
+int main(int argc, const char** argv)
 {
-    return WebKit::XPCServiceMain();
+    return WebKit::XPCServiceMain(argc, argv);
 }
index 2fb8e1a..dfb005d 100644 (file)
@@ -463,6 +463,8 @@ UIProcess/WebStorage/StorageManager.cpp
 
 UIProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm
 
+WebProcess/API/Cocoa/WKWebProcess.cpp
+
 WebProcess/ApplePay/WebPaymentCoordinator.cpp
 
 WebProcess/cocoa/PlaybackSessionManager.mm
index 95cd752..899c85f 100644 (file)
@@ -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 @@ static WKProcessPool *sharedProcessPool;
     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);
index 0c89e27..0d61570 100644 (file)
@@ -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;
index 14253fc..04dc3b5 100644 (file)
                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>"; };
                        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 = (
                BC032D5C10F436D50058C15A /* WebProcess */ = {
                        isa = PBXGroup;
                        children = (
+                               5C74300C21500434004BFA17 /* API */,
                                1AB1F7701D1B2F5D007C9BD1 /* ApplePay */,
                                1C0A19431C8FF1A800FE0EBB /* Automation */,
                                41D129D81F3D101400D15E47 /* Cache */,
diff --git a/Source/WebKit/WebProcess/API/Cocoa/WKWebProcess.cpp b/Source/WebKit/WebProcess/API/Cocoa/WKWebProcess.cpp
new file mode 100644 (file)
index 0000000..ac7e289
--- /dev/null
@@ -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);
+}
diff --git a/Source/WebKit/WebProcess/API/Cocoa/WKWebProcess.h b/Source/WebKit/WebProcess/API/Cocoa/WKWebProcess.h
new file mode 100644 (file)
index 0000000..9789ee4
--- /dev/null
@@ -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