Title: [264199] trunk
Revision
264199
Author
[email protected]
Date
2020-07-09 14:54:22 -0700 (Thu, 09 Jul 2020)

Log Message

Move XPCEndpoint and XPCEndpointClient classes from WebCore to WebKit
https://bugs.webkit.org/show_bug.cgi?id=214099

Reviewed by Alex Christensen.

Source/WebCore:

These classes should not be in WebCore, but in WebKit, since they are only expected to be used there.

No new tests, since this patch is only moving source files.

* WebCore.xcodeproj/project.pbxproj:
* platform/cocoa/XPCEndpoint.h: Removed.
* platform/cocoa/XPCEndpoint.mm: Removed.
* platform/cocoa/XPCEndpointClient.h: Removed.
* platform/cocoa/XPCEndpointClient.mm: Removed.

Source/WebKit:

* NetworkProcess/cocoa/LaunchServicesDatabaseObserver.h:
* Shared/Cocoa/XPCEndpoint.h: Copied from Source/WebCore/platform/cocoa/XPCEndpoint.h.
* Shared/Cocoa/XPCEndpoint.mm: Copied from Source/WebCore/platform/cocoa/XPCEndpoint.mm.
(WebCore::XPCEndpoint::XPCEndpoint): Deleted.
(WebCore::XPCEndpoint::sendEndpointToConnection): Deleted.
(WebCore::XPCEndpoint::endpoint const): Deleted.
* Shared/Cocoa/XPCEndpointClient.h: Copied from Source/WebCore/platform/cocoa/XPCEndpointClient.h.
(WebCore::XPCEndpointClient::~XPCEndpointClient): Deleted.
* Shared/Cocoa/XPCEndpointClient.mm: Copied from Source/WebCore/platform/cocoa/XPCEndpointClient.mm.
(WebCore::XPCEndpointClient::setEndpoint): Deleted.
(WebCore::XPCEndpointClient::connection): Deleted.
* UIProcess/Network/NetworkProcessProxyCocoa.mm:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/cocoa/LaunchServicesDatabaseManager.h:
* WebProcess/cocoa/LaunchServicesDatabaseManager.mm:
* WebProcess/cocoa/WebProcessCocoa.mm:

Tools:

* TestWebKitAPI/Tests/WebKit/XPCEndpoint.mm:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (264198 => 264199)


--- trunk/Source/WebCore/ChangeLog	2020-07-09 21:36:55 UTC (rev 264198)
+++ trunk/Source/WebCore/ChangeLog	2020-07-09 21:54:22 UTC (rev 264199)
@@ -1,3 +1,20 @@
+2020-07-09  Per Arne Vollan  <[email protected]>
+
+        Move XPCEndpoint and XPCEndpointClient classes from WebCore to WebKit
+        https://bugs.webkit.org/show_bug.cgi?id=214099
+
+        Reviewed by Alex Christensen.
+
+        These classes should not be in WebCore, but in WebKit, since they are only expected to be used there.
+
+        No new tests, since this patch is only moving source files.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/cocoa/XPCEndpoint.h: Removed.
+        * platform/cocoa/XPCEndpoint.mm: Removed.
+        * platform/cocoa/XPCEndpointClient.h: Removed.
+        * platform/cocoa/XPCEndpointClient.mm: Removed.
+
 2020-07-09  Simon Fraser  <[email protected]>
 
         After a scroll gesture, content changes don't trigger re-snapping with scroll snap

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (264198 => 264199)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2020-07-09 21:36:55 UTC (rev 264198)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2020-07-09 21:54:22 UTC (rev 264199)
@@ -4003,10 +4003,6 @@
 		C149D55D242EA6B9003EBB12 /* SleepDisabler.h in Headers */ = {isa = PBXBuildFile; fileRef = C149D55A242EA4F9003EBB12 /* SleepDisabler.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		C149D55F242EA7B8003EBB12 /* SleepDisablerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = C149D55B242EA4FA003EBB12 /* SleepDisablerClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		C149D567242EB84A003EBB12 /* SleepDisablerIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = C149D565242EB765003EBB12 /* SleepDisablerIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		C14D304924B4EAB100480387 /* XPCEndpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = C14D304724B4EAA800480387 /* XPCEndpoint.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		C14D304B24B4F7EF00480387 /* XPCEndpoint.mm in Sources */ = {isa = PBXBuildFile; fileRef = C14D304A24B4EB1E00480387 /* XPCEndpoint.mm */; };
-		C14D304E24B4F8FA00480387 /* XPCEndpointClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = C14D304C24B4F8F600480387 /* XPCEndpointClient.mm */; };
-		C14D304F24B4F8FF00480387 /* XPCEndpointClient.h in Headers */ = {isa = PBXBuildFile; fileRef = C14D304D24B4F8F700480387 /* XPCEndpointClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		C1692DD223D23ABD006E88F7 /* SystemBattery.mm in Sources */ = {isa = PBXBuildFile; fileRef = C1692DD123D23ABD006E88F7 /* SystemBattery.mm */; };
 		C1692DD523D23E08006E88F7 /* SystemBattery.h in Headers */ = {isa = PBXBuildFile; fileRef = C1692DD423D23AE0006E88F7 /* SystemBattery.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		C1E1D236203DF15400584665 /* ScreenProperties.h in Headers */ = {isa = PBXBuildFile; fileRef = C1E1D235203DF15400584665 /* ScreenProperties.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -13738,10 +13734,6 @@
 		C149D55A242EA4F9003EBB12 /* SleepDisabler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SleepDisabler.h; sourceTree = "<group>"; };
 		C149D55B242EA4FA003EBB12 /* SleepDisablerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SleepDisablerClient.h; sourceTree = "<group>"; };
 		C149D565242EB765003EBB12 /* SleepDisablerIdentifier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SleepDisablerIdentifier.h; sourceTree = "<group>"; };
-		C14D304724B4EAA800480387 /* XPCEndpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPCEndpoint.h; sourceTree = "<group>"; };
-		C14D304A24B4EB1E00480387 /* XPCEndpoint.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = XPCEndpoint.mm; sourceTree = "<group>"; };
-		C14D304C24B4F8F600480387 /* XPCEndpointClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = XPCEndpointClient.mm; sourceTree = "<group>"; };
-		C14D304D24B4F8F700480387 /* XPCEndpointClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPCEndpointClient.h; sourceTree = "<group>"; };
 		C1692DD123D23ABD006E88F7 /* SystemBattery.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SystemBattery.mm; sourceTree = "<group>"; };
 		C1692DD423D23AE0006E88F7 /* SystemBattery.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SystemBattery.h; sourceTree = "<group>"; };
 		C18FB518242F9382007E9875 /* SleepDisablerClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SleepDisablerClient.cpp; sourceTree = "<group>"; };
@@ -23648,10 +23640,6 @@
 				CDC979F31C498C0900DB50D4 /* WebCoreNSErrorExtras.h */,
 				CDC979F21C498C0900DB50D4 /* WebCoreNSErrorExtras.mm */,
 				5DFEBAB618592B6D00C75BEB /* WebKitAvailability.h */,
-				C14D304724B4EAA800480387 /* XPCEndpoint.h */,
-				C14D304A24B4EB1E00480387 /* XPCEndpoint.mm */,
-				C14D304D24B4F8F700480387 /* XPCEndpointClient.h */,
-				C14D304C24B4F8F600480387 /* XPCEndpointClient.mm */,
 			);
 			path = cocoa;
 			sourceTree = "<group>";
@@ -34018,8 +34006,6 @@
 				1AB7FC840A8B92EC00D9D37B /* XPathUtil.h in Headers */,
 				1AB7FC860A8B92EC00D9D37B /* XPathValue.h in Headers */,
 				1AB7FC880A8B92EC00D9D37B /* XPathVariableReference.h in Headers */,
-				C14D304924B4EAB100480387 /* XPCEndpoint.h in Headers */,
-				C14D304F24B4F8FF00480387 /* XPCEndpointClient.h in Headers */,
 				E1EE8B9C2413195000E794D6 /* XREnvironmentBlendMode.h in Headers */,
 				E1EE8B972413195000E794D6 /* XREye.h in Headers */,
 				E1EE8B8F2413195000E794D6 /* XRFrameRequestCallback.h in Headers */,
@@ -35215,8 +35201,6 @@
 				A833C7CC0A2CF07400D57664 /* XLinkNames.cpp in Sources */,
 				A833C80C0A2CF25600D57664 /* XMLNames.cpp in Sources */,
 				E15A36D91104572700B7B639 /* XMLNSNames.cpp in Sources */,
-				C14D304B24B4F7EF00480387 /* XPCEndpoint.mm in Sources */,
-				C14D304E24B4F8FA00480387 /* XPCEndpointClient.mm in Sources */,
 				E1EE8B7A2413191F00E794D6 /* XRInputSourceEvent.cpp in Sources */,
 				E1EE8BA72413196300E794D6 /* XRInputSourcesChangeEvent.cpp in Sources */,
 				E1EE8B952413195000E794D6 /* XRReferenceSpaceEvent.cpp in Sources */,

Deleted: trunk/Source/WebCore/platform/cocoa/XPCEndpoint.h (264198 => 264199)


--- trunk/Source/WebCore/platform/cocoa/XPCEndpoint.h	2020-07-09 21:36:55 UTC (rev 264198)
+++ trunk/Source/WebCore/platform/cocoa/XPCEndpoint.h	2020-07-09 21:54:22 UTC (rev 264199)
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2020 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 <wtf/OSObjectPtr.h>
-#include <wtf/spi/darwin/XPCSPI.h>
-
-namespace WebCore {
-
-class XPCEndpoint {
-public:
-    WEBCORE_EXPORT XPCEndpoint();
-    WEBCORE_EXPORT virtual ~XPCEndpoint() = default;
-
-    WEBCORE_EXPORT void sendEndpointToConnection(xpc_connection_t);
-
-    WEBCORE_EXPORT OSObjectPtr<xpc_endpoint_t> endpoint() const;
-
-    static constexpr auto xpcMessageNameKey = "message-name";
-
-private:
-    virtual const char* xpcEndpointMessageNameKey() const = 0;
-    virtual const char* xpcEndpointMessageName() const = 0;
-    virtual const char* xpcEndpointNameKey() const = 0;
-    virtual void handleEvent(xpc_connection_t, xpc_object_t) = 0;
-
-    OSObjectPtr<xpc_connection_t> m_connection;
-    OSObjectPtr<xpc_endpoint_t> m_endpoint;
-};
-
-}

Deleted: trunk/Source/WebCore/platform/cocoa/XPCEndpoint.mm (264198 => 264199)


--- trunk/Source/WebCore/platform/cocoa/XPCEndpoint.mm	2020-07-09 21:36:55 UTC (rev 264198)
+++ trunk/Source/WebCore/platform/cocoa/XPCEndpoint.mm	2020-07-09 21:54:22 UTC (rev 264199)
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2020 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.
- */
-
-#import "config.h"
-#import "XPCEndpoint.h"
-
-#import <wtf/cocoa/Entitlements.h>
-
-namespace WebCore {
-
-XPCEndpoint::XPCEndpoint()
-{
-    m_connection = adoptOSObject(xpc_connection_create(nullptr, nullptr));
-    m_endpoint = adoptOSObject(xpc_endpoint_create(m_connection.get()));
-
-    xpc_connection_set_target_queue(m_connection.get(), dispatch_get_main_queue());
-    xpc_connection_set_event_handler(m_connection.get(), ^(xpc_object_t message) {
-        xpc_type_t type = xpc_get_type(message);
-
-        if (type == XPC_TYPE_CONNECTION) {
-            xpc_connection_t connection = message;
-            audit_token_t auditToken;
-            xpc_connection_get_audit_token(connection, &auditToken);
-
-            if (!WTF::hasEntitlement(auditToken, "com.apple.private.webkit.use-xpc-endpoint")) {
-                // Uncomment before landing; this is commented out because the bots does not seem to update the entitlements on incremental builds.
-                // WTFLogAlways("Audit token does not have required entitlement");
-                // return;
-            }
-            xpc_connection_set_target_queue(connection, dispatch_get_main_queue());
-            xpc_connection_set_event_handler(connection, ^(xpc_object_t event) {
-                handleEvent(connection, event);
-            });
-            xpc_connection_resume(connection);
-        }
-    });
-    xpc_connection_resume(m_connection.get());
-}
-
-void XPCEndpoint::sendEndpointToConnection(xpc_connection_t connection)
-{
-    if (!connection)
-        return;
-
-    auto message = adoptOSObject(xpc_dictionary_create(nullptr, nullptr, 0));
-    xpc_dictionary_set_string(message.get(), xpcEndpointMessageNameKey(), xpcEndpointMessageName());
-    xpc_dictionary_set_value(message.get(), xpcEndpointNameKey(), m_endpoint.get());
-
-    xpc_connection_send_message(connection, message.get());
-}
-
-OSObjectPtr<xpc_endpoint_t> XPCEndpoint::endpoint() const
-{
-    return m_endpoint;
-}
-
-}

Deleted: trunk/Source/WebCore/platform/cocoa/XPCEndpointClient.h (264198 => 264199)


--- trunk/Source/WebCore/platform/cocoa/XPCEndpointClient.h	2020-07-09 21:36:55 UTC (rev 264198)
+++ trunk/Source/WebCore/platform/cocoa/XPCEndpointClient.h	2020-07-09 21:54:22 UTC (rev 264199)
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2020 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 <wtf/Lock.h>
-#include <wtf/OSObjectPtr.h>
-#include <wtf/spi/darwin/XPCSPI.h>
-
-namespace WebCore {
-
-class XPCEndpointClient {
-public:
-    virtual ~XPCEndpointClient() { }
-
-    WEBCORE_EXPORT void setEndpoint(xpc_endpoint_t);
-
-protected:
-    WEBCORE_EXPORT OSObjectPtr<xpc_connection_t> connection();
-
-private:
-    virtual void handleEvent(xpc_object_t) = 0;
-    virtual void didConnect() = 0;
-
-    OSObjectPtr<xpc_connection_t> m_connection;
-    Lock m_lock;
-};
-
-}

Deleted: trunk/Source/WebCore/platform/cocoa/XPCEndpointClient.mm (264198 => 264199)


--- trunk/Source/WebCore/platform/cocoa/XPCEndpointClient.mm	2020-07-09 21:36:55 UTC (rev 264198)
+++ trunk/Source/WebCore/platform/cocoa/XPCEndpointClient.mm	2020-07-09 21:54:22 UTC (rev 264199)
@@ -1,81 +0,0 @@
-/*
-* Copyright (C) 2020 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.
-*/
-
-#import "config.h"
-#import "XPCEndpointClient.h"
-
-#import <wtf/cocoa/Entitlements.h>
-
-namespace WebCore {
-
-void XPCEndpointClient::setEndpoint(xpc_endpoint_t endpoint)
-{
-    {
-        LockHolder locker(m_lock);
-
-        if (m_connection)
-            return;
-
-        m_connection = adoptOSObject(xpc_connection_create_from_endpoint(endpoint));
-
-        xpc_connection_set_target_queue(m_connection.get(), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0));
-        xpc_connection_set_event_handler(m_connection.get(), ^(xpc_object_t message) {
-            xpc_type_t type = xpc_get_type(message);
-            if (type == XPC_TYPE_ERROR) {
-                if (message == XPC_ERROR_CONNECTION_INVALID || message == XPC_ERROR_TERMINATION_IMMINENT) {
-                    LockHolder locker(m_lock);
-                    m_connection = nullptr;
-                }
-                return;
-            }
-            if (type != XPC_TYPE_DICTIONARY)
-                return;
-
-            auto connection = xpc_dictionary_get_remote_connection(message);
-            if (!connection)
-                return;
-            audit_token_t auditToken;
-            xpc_connection_get_audit_token(connection, &auditToken);
-            if (!WTF::hasEntitlement(auditToken, "com.apple.private.webkit.use-xpc-endpoint")) {
-                // Uncomment before landing; this is commented out because the bots does not seem to update the entitlements on incremental builds.
-                // WTFLogAlways("Audit token does not have required entitlement");
-                // return;
-            }
-            handleEvent(message);
-        });
-
-        xpc_connection_resume(m_connection.get());
-    }
-
-    didConnect();
-}
-
-OSObjectPtr<xpc_connection_t> XPCEndpointClient::connection()
-{
-    LockHolder locker(m_lock);
-    return m_connection;
-}
-
-}

Modified: trunk/Source/WebKit/ChangeLog (264198 => 264199)


--- trunk/Source/WebKit/ChangeLog	2020-07-09 21:36:55 UTC (rev 264198)
+++ trunk/Source/WebKit/ChangeLog	2020-07-09 21:54:22 UTC (rev 264199)
@@ -1,3 +1,27 @@
+2020-07-09  Per Arne Vollan  <[email protected]>
+
+        Move XPCEndpoint and XPCEndpointClient classes from WebCore to WebKit
+        https://bugs.webkit.org/show_bug.cgi?id=214099
+
+        Reviewed by Alex Christensen.
+
+        * NetworkProcess/cocoa/LaunchServicesDatabaseObserver.h:
+        * Shared/Cocoa/XPCEndpoint.h: Copied from Source/WebCore/platform/cocoa/XPCEndpoint.h.
+        * Shared/Cocoa/XPCEndpoint.mm: Copied from Source/WebCore/platform/cocoa/XPCEndpoint.mm.
+        (WebCore::XPCEndpoint::XPCEndpoint): Deleted.
+        (WebCore::XPCEndpoint::sendEndpointToConnection): Deleted.
+        (WebCore::XPCEndpoint::endpoint const): Deleted.
+        * Shared/Cocoa/XPCEndpointClient.h: Copied from Source/WebCore/platform/cocoa/XPCEndpointClient.h.
+        (WebCore::XPCEndpointClient::~XPCEndpointClient): Deleted.
+        * Shared/Cocoa/XPCEndpointClient.mm: Copied from Source/WebCore/platform/cocoa/XPCEndpointClient.mm.
+        (WebCore::XPCEndpointClient::setEndpoint): Deleted.
+        (WebCore::XPCEndpointClient::connection): Deleted.
+        * UIProcess/Network/NetworkProcessProxyCocoa.mm:
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebProcess/cocoa/LaunchServicesDatabaseManager.h:
+        * WebProcess/cocoa/LaunchServicesDatabaseManager.mm:
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+
 2020-07-09  Zalan Bujtas  <[email protected]>
 
         [iOS] Conversation view messages in Mail are too small and scrollable

Modified: trunk/Source/WebKit/NetworkProcess/cocoa/LaunchServicesDatabaseObserver.h (264198 => 264199)


--- trunk/Source/WebKit/NetworkProcess/cocoa/LaunchServicesDatabaseObserver.h	2020-07-09 21:36:55 UTC (rev 264198)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/LaunchServicesDatabaseObserver.h	2020-07-09 21:54:22 UTC (rev 264199)
@@ -27,13 +27,13 @@
 
 #include "NetworkProcess.h"
 #include "NetworkProcessSupplement.h"
-#include <WebCore/XPCEndpoint.h>
+#include "XPCEndpoint.h"
 #include <wtf/OSObjectPtr.h>
 #include <wtf/RetainPtr.h>
 
 namespace WebKit {
 
-class LaunchServicesDatabaseObserver : public WebCore::XPCEndpoint, public NetworkProcessSupplement {
+class LaunchServicesDatabaseObserver : public WebKit::XPCEndpoint, public NetworkProcessSupplement {
     WTF_MAKE_FAST_ALLOCATED;
 public:
     LaunchServicesDatabaseObserver(NetworkProcess&);

Copied: trunk/Source/WebKit/Shared/Cocoa/XPCEndpoint.h (from rev 264198, trunk/Source/WebCore/platform/cocoa/XPCEndpoint.h) (0 => 264199)


--- trunk/Source/WebKit/Shared/Cocoa/XPCEndpoint.h	                        (rev 0)
+++ trunk/Source/WebKit/Shared/Cocoa/XPCEndpoint.h	2020-07-09 21:54:22 UTC (rev 264199)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2020 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 "WKDeclarationSpecifiers.h"
+#include <wtf/OSObjectPtr.h>
+#include <wtf/spi/darwin/XPCSPI.h>
+
+namespace WebKit {
+
+class XPCEndpoint {
+public:
+    WK_EXPORT XPCEndpoint();
+    WK_EXPORT virtual ~XPCEndpoint() = default;
+
+    WK_EXPORT void sendEndpointToConnection(xpc_connection_t);
+
+    WK_EXPORT OSObjectPtr<xpc_endpoint_t> endpoint() const;
+
+    static constexpr auto xpcMessageNameKey = "message-name";
+
+private:
+    virtual const char* xpcEndpointMessageNameKey() const = 0;
+    virtual const char* xpcEndpointMessageName() const = 0;
+    virtual const char* xpcEndpointNameKey() const = 0;
+    virtual void handleEvent(xpc_connection_t, xpc_object_t) = 0;
+
+    OSObjectPtr<xpc_connection_t> m_connection;
+    OSObjectPtr<xpc_endpoint_t> m_endpoint;
+};
+
+}

Copied: trunk/Source/WebKit/Shared/Cocoa/XPCEndpoint.mm (from rev 264198, trunk/Source/WebCore/platform/cocoa/XPCEndpoint.mm) (0 => 264199)


--- trunk/Source/WebKit/Shared/Cocoa/XPCEndpoint.mm	                        (rev 0)
+++ trunk/Source/WebKit/Shared/Cocoa/XPCEndpoint.mm	2020-07-09 21:54:22 UTC (rev 264199)
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2020 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.
+ */
+
+#import "config.h"
+#import "XPCEndpoint.h"
+
+#import <wtf/cocoa/Entitlements.h>
+
+namespace WebKit {
+
+XPCEndpoint::XPCEndpoint()
+{
+    m_connection = adoptOSObject(xpc_connection_create(nullptr, nullptr));
+    m_endpoint = adoptOSObject(xpc_endpoint_create(m_connection.get()));
+
+    xpc_connection_set_target_queue(m_connection.get(), dispatch_get_main_queue());
+    xpc_connection_set_event_handler(m_connection.get(), ^(xpc_object_t message) {
+        xpc_type_t type = xpc_get_type(message);
+
+        if (type == XPC_TYPE_CONNECTION) {
+            xpc_connection_t connection = message;
+            audit_token_t auditToken;
+            xpc_connection_get_audit_token(connection, &auditToken);
+
+            if (!WTF::hasEntitlement(auditToken, "com.apple.private.webkit.use-xpc-endpoint")) {
+                // Uncomment before landing; this is commented out because the bots does not seem to update the entitlements on incremental builds.
+                // WTFLogAlways("Audit token does not have required entitlement");
+                // return;
+            }
+            xpc_connection_set_target_queue(connection, dispatch_get_main_queue());
+            xpc_connection_set_event_handler(connection, ^(xpc_object_t event) {
+                handleEvent(connection, event);
+            });
+            xpc_connection_resume(connection);
+        }
+    });
+    xpc_connection_resume(m_connection.get());
+}
+
+void XPCEndpoint::sendEndpointToConnection(xpc_connection_t connection)
+{
+    if (!connection)
+        return;
+
+    auto message = adoptOSObject(xpc_dictionary_create(nullptr, nullptr, 0));
+    xpc_dictionary_set_string(message.get(), xpcEndpointMessageNameKey(), xpcEndpointMessageName());
+    xpc_dictionary_set_value(message.get(), xpcEndpointNameKey(), m_endpoint.get());
+
+    xpc_connection_send_message(connection, message.get());
+}
+
+OSObjectPtr<xpc_endpoint_t> XPCEndpoint::endpoint() const
+{
+    return m_endpoint;
+}
+
+}

Copied: trunk/Source/WebKit/Shared/Cocoa/XPCEndpointClient.h (from rev 264198, trunk/Source/WebCore/platform/cocoa/XPCEndpointClient.h) (0 => 264199)


--- trunk/Source/WebKit/Shared/Cocoa/XPCEndpointClient.h	                        (rev 0)
+++ trunk/Source/WebKit/Shared/Cocoa/XPCEndpointClient.h	2020-07-09 21:54:22 UTC (rev 264199)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2020 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 "WKDeclarationSpecifiers.h"
+#include <wtf/Lock.h>
+#include <wtf/OSObjectPtr.h>
+#include <wtf/spi/darwin/XPCSPI.h>
+
+namespace WebKit {
+
+class XPCEndpointClient {
+public:
+    virtual ~XPCEndpointClient() { }
+
+    WK_EXPORT void setEndpoint(xpc_endpoint_t);
+
+protected:
+    WK_EXPORT OSObjectPtr<xpc_connection_t> connection();
+
+private:
+    virtual void handleEvent(xpc_object_t) = 0;
+    virtual void didConnect() = 0;
+
+    OSObjectPtr<xpc_connection_t> m_connection;
+    Lock m_lock;
+};
+
+}

Copied: trunk/Source/WebKit/Shared/Cocoa/XPCEndpointClient.mm (from rev 264198, trunk/Source/WebCore/platform/cocoa/XPCEndpointClient.mm) (0 => 264199)


--- trunk/Source/WebKit/Shared/Cocoa/XPCEndpointClient.mm	                        (rev 0)
+++ trunk/Source/WebKit/Shared/Cocoa/XPCEndpointClient.mm	2020-07-09 21:54:22 UTC (rev 264199)
@@ -0,0 +1,81 @@
+/*
+* Copyright (C) 2020 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.
+*/
+
+#import "config.h"
+#import "XPCEndpointClient.h"
+
+#import <wtf/cocoa/Entitlements.h>
+
+namespace WebKit {
+
+void XPCEndpointClient::setEndpoint(xpc_endpoint_t endpoint)
+{
+    {
+        LockHolder locker(m_lock);
+
+        if (m_connection)
+            return;
+
+        m_connection = adoptOSObject(xpc_connection_create_from_endpoint(endpoint));
+
+        xpc_connection_set_target_queue(m_connection.get(), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0));
+        xpc_connection_set_event_handler(m_connection.get(), ^(xpc_object_t message) {
+            xpc_type_t type = xpc_get_type(message);
+            if (type == XPC_TYPE_ERROR) {
+                if (message == XPC_ERROR_CONNECTION_INVALID || message == XPC_ERROR_TERMINATION_IMMINENT) {
+                    LockHolder locker(m_lock);
+                    m_connection = nullptr;
+                }
+                return;
+            }
+            if (type != XPC_TYPE_DICTIONARY)
+                return;
+
+            auto connection = xpc_dictionary_get_remote_connection(message);
+            if (!connection)
+                return;
+            audit_token_t auditToken;
+            xpc_connection_get_audit_token(connection, &auditToken);
+            if (!WTF::hasEntitlement(auditToken, "com.apple.private.webkit.use-xpc-endpoint")) {
+                // Uncomment before landing; this is commented out because the bots does not seem to update the entitlements on incremental builds.
+                // WTFLogAlways("Audit token does not have required entitlement");
+                // return;
+            }
+            handleEvent(message);
+        });
+
+        xpc_connection_resume(m_connection.get());
+    }
+
+    didConnect();
+}
+
+OSObjectPtr<xpc_connection_t> XPCEndpointClient::connection()
+{
+    LockHolder locker(m_lock);
+    return m_connection;
+}
+
+}

Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxyCocoa.mm (264198 => 264199)


--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxyCocoa.mm	2020-07-09 21:36:55 UTC (rev 264198)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxyCocoa.mm	2020-07-09 21:54:22 UTC (rev 264199)
@@ -28,7 +28,7 @@
 
 #import "LaunchServicesDatabaseXPCConstants.h"
 #import "WebProcessPool.h"
-#import <WebCore/XPCEndpoint.h>
+#import "XPCEndpoint.h"
 
 namespace WebKit {
 

Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (264198 => 264199)


--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2020-07-09 21:36:55 UTC (rev 264198)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2020-07-09 21:54:22 UTC (rev 264199)
@@ -1684,9 +1684,13 @@
 		C11A9ECC214035F800CFB20A /* WebSwitchingGPUClient.h in Headers */ = {isa = PBXBuildFile; fileRef = C11A9ECB214035F800CFB20A /* WebSwitchingGPUClient.h */; };
 		C11E1694212B87C500985FF6 /* WKMockDisplay.h in Headers */ = {isa = PBXBuildFile; fileRef = C11E1692212B87C500985FF6 /* WKMockDisplay.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		C149380922347104000CD707 /* WebSpeechSynthesisClient.h in Headers */ = {isa = PBXBuildFile; fileRef = C149380222341C60000CD707 /* WebSpeechSynthesisClient.h */; };
+		C14D306924B79BE000480387 /* XPCEndpoint.mm in Sources */ = {isa = PBXBuildFile; fileRef = C14D306524B794E700480387 /* XPCEndpoint.mm */; };
+		C14D306A24B79BE400480387 /* XPCEndpointClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = C14D306624B794E700480387 /* XPCEndpointClient.mm */; };
 		C14D37FE24ACE086007FF014 /* LaunchServicesDatabaseManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = C14D37FD24ACE086007FF014 /* LaunchServicesDatabaseManager.mm */; };
 		C15CBB3623F3777100300CC7 /* PreferenceObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = C145CC0E23DCA427003A5EEB /* PreferenceObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		C15CBB3723F37ECB00300CC7 /* PreferenceObserver.mm in Sources */ = {isa = PBXBuildFile; fileRef = C15CBB3323F34C3800300CC7 /* PreferenceObserver.mm */; };
+		C15E6CB324B7BE6F00E501A2 /* XPCEndpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = C14D306724B794E700480387 /* XPCEndpoint.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		C15E6CB424B7BE7600E501A2 /* XPCEndpointClient.h in Headers */ = {isa = PBXBuildFile; fileRef = C14D306824B794E700480387 /* XPCEndpointClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		C1663E5B24AEAA2F00C6A3B2 /* LaunchServicesDatabaseXPCConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = C1663E5A24AEA74200C6A3B2 /* LaunchServicesDatabaseXPCConstants.h */; };
 		C1710CF724AA643200D7C112 /* LaunchServicesDatabaseObserver.mm in Sources */ = {isa = PBXBuildFile; fileRef = C1710CF624AA643200D7C112 /* LaunchServicesDatabaseObserver.mm */; };
 		C18173612058424700DFDA65 /* DisplayLink.h in Headers */ = {isa = PBXBuildFile; fileRef = C18173602058424700DFDA65 /* DisplayLink.h */; };
@@ -5021,6 +5025,10 @@
 		C149380222341C60000CD707 /* WebSpeechSynthesisClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebSpeechSynthesisClient.h; sourceTree = "<group>"; };
 		C149380322341DF7000CD707 /* WebSpeechSynthesisClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebSpeechSynthesisClient.cpp; sourceTree = "<group>"; };
 		C149380A223853BE000CD707 /* WebSpeechSynthesisVoice.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebSpeechSynthesisVoice.h; sourceTree = "<group>"; };
+		C14D306524B794E700480387 /* XPCEndpoint.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = XPCEndpoint.mm; sourceTree = "<group>"; };
+		C14D306624B794E700480387 /* XPCEndpointClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = XPCEndpointClient.mm; sourceTree = "<group>"; };
+		C14D306724B794E700480387 /* XPCEndpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPCEndpoint.h; sourceTree = "<group>"; };
+		C14D306824B794E700480387 /* XPCEndpointClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPCEndpointClient.h; sourceTree = "<group>"; };
 		C14D37FC24ACDF45007FF014 /* LaunchServicesDatabaseManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LaunchServicesDatabaseManager.h; sourceTree = "<group>"; };
 		C14D37FD24ACE086007FF014 /* LaunchServicesDatabaseManager.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = LaunchServicesDatabaseManager.mm; sourceTree = "<group>"; };
 		C15CBB3323F34C3800300CC7 /* PreferenceObserver.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PreferenceObserver.mm; sourceTree = "<group>"; };
@@ -7526,6 +7534,10 @@
 				37BF2F051947DEB400723C48 /* WKNSURLRequest.mm */,
 				378E1A3F181EDA010031007A /* WKObject.h */,
 				374436871820E7240049579F /* WKObject.mm */,
+				C14D306724B794E700480387 /* XPCEndpoint.h */,
+				C14D306524B794E700480387 /* XPCEndpoint.mm */,
+				C14D306824B794E700480387 /* XPCEndpointClient.h */,
+				C14D306624B794E700480387 /* XPCEndpointClient.mm */,
 			);
 			name = cocoa;
 			path = Cocoa;
@@ -11865,6 +11877,8 @@
 				1AD60F6018E20F740020C034 /* WKWindowFeaturesInternal.h in Headers */,
 				6A5080BF1F0EDAAA00E617C5 /* WKWindowFeaturesPrivate.h in Headers */,
 				1A7C0DF71B7D1F1000A9B848 /* WKWindowFeaturesRef.h in Headers */,
+				C15E6CB324B7BE6F00E501A2 /* XPCEndpoint.h in Headers */,
+				C15E6CB424B7BE7600E501A2 /* XPCEndpointClient.h in Headers */,
 				BCBECDE816B6416800047A1A /* XPCServiceEntryPoint.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -13114,6 +13128,8 @@
 				1DB01944211CF005009FB3E8 /* WKShareSheet.mm in Sources */,
 				7A78FF332241919B0096483E /* WKStorageAccessAlert.mm in Sources */,
 				CE212160240EE571006ED443 /* WKTextPlaceholder.mm in Sources */,
+				C14D306924B79BE000480387 /* XPCEndpoint.mm in Sources */,
+				C14D306A24B79BE400480387 /* XPCEndpointClient.mm in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Modified: trunk/Source/WebKit/WebProcess/cocoa/LaunchServicesDatabaseManager.h (264198 => 264199)


--- trunk/Source/WebKit/WebProcess/cocoa/LaunchServicesDatabaseManager.h	2020-07-09 21:36:55 UTC (rev 264198)
+++ trunk/Source/WebKit/WebProcess/cocoa/LaunchServicesDatabaseManager.h	2020-07-09 21:54:22 UTC (rev 264199)
@@ -25,13 +25,13 @@
 
 #pragma once
 
-#import <WebCore/XPCEndpointClient.h>
+#import "XPCEndpointClient.h"
 #import <wtf/NeverDestroyed.h>
 #import <wtf/threads/BinarySemaphore.h>
 
 namespace WebKit {
 
-class LaunchServicesDatabaseManager : public WebCore::XPCEndpointClient {
+class LaunchServicesDatabaseManager : public WebKit::XPCEndpointClient {
 public:
     static LaunchServicesDatabaseManager& singleton();
 

Modified: trunk/Source/WebKit/WebProcess/cocoa/LaunchServicesDatabaseManager.mm (264198 => 264199)


--- trunk/Source/WebKit/WebProcess/cocoa/LaunchServicesDatabaseManager.mm	2020-07-09 21:36:55 UTC (rev 264198)
+++ trunk/Source/WebKit/WebProcess/cocoa/LaunchServicesDatabaseManager.mm	2020-07-09 21:54:22 UTC (rev 264199)
@@ -27,7 +27,7 @@
 #import "LaunchServicesDatabaseManager.h"
 
 #import "LaunchServicesDatabaseXPCConstants.h"
-#import <WebCore/XPCEndpoint.h>
+#import "XPCEndpoint.h"
 #import <pal/spi/cocoa/LaunchServicesSPI.h>
 #import <wtf/cocoa/Entitlements.h>
 #import <wtf/spi/darwin/XPCSPI.h>
@@ -35,8 +35,6 @@
 
 namespace WebKit {
 
-using namespace WebCore;
-
 LaunchServicesDatabaseManager& LaunchServicesDatabaseManager::singleton()
 {
     static NeverDestroyed<LaunchServicesDatabaseManager> manager;

Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (264198 => 264199)


--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2020-07-09 21:36:55 UTC (rev 264198)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2020-07-09 21:54:22 UTC (rev 264199)
@@ -50,6 +50,7 @@
 #import "WebProcessProxyMessages.h"
 #import "WebSleepDisablerClient.h"
 #import "WebsiteDataStoreParameters.h"
+#import "XPCEndpoint.h"
 #import <_javascript_Core/ConfigFile.h>
 #import <_javascript_Core/Options.h>
 #import <WebCore/AVAssetMIMETypeCache.h>
@@ -71,7 +72,6 @@
 #import <WebCore/SWContextManager.h>
 #import <WebCore/SystemBattery.h>
 #import <WebCore/UTIUtilities.h>
-#import <WebCore/XPCEndpoint.h>
 #import <algorithm>
 #import <dispatch/dispatch.h>
 #import <objc/runtime.h>

Modified: trunk/Tools/ChangeLog (264198 => 264199)


--- trunk/Tools/ChangeLog	2020-07-09 21:36:55 UTC (rev 264198)
+++ trunk/Tools/ChangeLog	2020-07-09 21:54:22 UTC (rev 264199)
@@ -1,3 +1,12 @@
+2020-07-09  Per Arne Vollan  <[email protected]>
+
+        Move XPCEndpoint and XPCEndpointClient classes from WebCore to WebKit
+        https://bugs.webkit.org/show_bug.cgi?id=214099
+
+        Reviewed by Alex Christensen.
+
+        * TestWebKitAPI/Tests/WebKit/XPCEndpoint.mm:
+
 2020-07-09  Aakash Jain  <[email protected]>
 
         Add EWS queues for tvOS and watchOS builders

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit/XPCEndpoint.mm (264198 => 264199)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit/XPCEndpoint.mm	2020-07-09 21:36:55 UTC (rev 264198)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit/XPCEndpoint.mm	2020-07-09 21:54:22 UTC (rev 264199)
@@ -26,8 +26,8 @@
 #import "config.h"
 #import "PlatformUtilities.h"
 
-#import <WebCore/XPCEndpoint.h>
-#import <WebCore/XPCEndpointClient.h>
+#import <WebKit/XPCEndpoint.h>
+#import <WebKit/XPCEndpointClient.h>
 #import <wtf/text/WTFString.h>
 
 static bool clientConnectedToEndpoint = false;
@@ -37,7 +37,7 @@
 static constexpr auto testMessageFromEndpoint = "test-message-from-endpoint";
 static constexpr auto testMessageFromClient = "test-message-from-client";
 
-class XPCEndpoint : public WebCore::XPCEndpoint {
+class XPCEndpoint : public WebKit::XPCEndpoint {
 private:
     const char* xpcEndpointMessageNameKey() const override
     {
@@ -64,7 +64,7 @@
     }
 };
 
-class XPCEndpointClient : public WebCore::XPCEndpointClient {
+class XPCEndpointClient : public WebKit::XPCEndpointClient {
 private:
     void handleEvent(xpc_object_t event) override
     {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to