Title: [264167] trunk/Source
Revision
264167
Author
[email protected]
Date
2020-07-09 07:02:14 -0700 (Thu, 09 Jul 2020)

Log Message

Unreviewed, reverting r264148.
https://bugs.webkit.org/show_bug.cgi?id=214136

Introduced layout test failures

Reverted changeset:

"[Cocoa] Update Launch Services database in the WebContent
process from the Network process"
https://bugs.webkit.org/show_bug.cgi?id=213794
https://trac.webkit.org/changeset/264148

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (264166 => 264167)


--- trunk/Source/WTF/ChangeLog	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WTF/ChangeLog	2020-07-09 14:02:14 UTC (rev 264167)
@@ -1,3 +1,17 @@
+2020-07-09  Commit Queue  <[email protected]>
+
+        Unreviewed, reverting r264148.
+        https://bugs.webkit.org/show_bug.cgi?id=214136
+
+        Introduced layout test failures
+
+        Reverted changeset:
+
+        "[Cocoa] Update Launch Services database in the WebContent
+        process from the Network process"
+        https://bugs.webkit.org/show_bug.cgi?id=213794
+        https://trac.webkit.org/changeset/264148
+
 2020-07-09  Xabier Rodriguez Calvar  <[email protected]>
 
         [WTF] Implement new BoxPtr alias

Modified: trunk/Source/WTF/wtf/PlatformHave.h (264166 => 264167)


--- trunk/Source/WTF/wtf/PlatformHave.h	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WTF/wtf/PlatformHave.h	2020-07-09 14:02:14 UTC (rev 264167)
@@ -672,10 +672,3 @@
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101600
 #define HAVE_APP_ACCENT_COLORS 1
 #endif
-
-#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101600) \
-    || ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) \
-    || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 70000) \
-    || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 140000)
-#define HAVE_LSDATABASECONTEXT 1
-#endif

Modified: trunk/Source/WebCore/PAL/ChangeLog (264166 => 264167)


--- trunk/Source/WebCore/PAL/ChangeLog	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebCore/PAL/ChangeLog	2020-07-09 14:02:14 UTC (rev 264167)
@@ -1,3 +1,17 @@
+2020-07-09  Commit Queue  <[email protected]>
+
+        Unreviewed, reverting r264148.
+        https://bugs.webkit.org/show_bug.cgi?id=214136
+
+        Introduced layout test failures
+
+        Reverted changeset:
+
+        "[Cocoa] Update Launch Services database in the WebContent
+        process from the Network process"
+        https://bugs.webkit.org/show_bug.cgi?id=213794
+        https://trac.webkit.org/changeset/264148
+
 2020-07-08  Per Arne Vollan  <[email protected]>
 
         [Cocoa] Update Launch Services database in the WebContent process from the Network process

Modified: trunk/Source/WebCore/PAL/pal/spi/cocoa/LaunchServicesSPI.h (264166 => 264167)


--- trunk/Source/WebCore/PAL/pal/spi/cocoa/LaunchServicesSPI.h	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebCore/PAL/pal/spi/cocoa/LaunchServicesSPI.h	2020-07-09 14:02:14 UTC (rev 264167)
@@ -25,10 +25,16 @@
 
 #import <Foundation/Foundation.h>
 
-#include <wtf/spi/darwin/XPCSPI.h>
+#if USE(APPLE_INTERNAL_SDK)
 
-#if USE(APPLE_INTERNAL_SDK)
+#if PLATFORM(MAC)
 #import <CoreServices/CoreServicesPriv.h>
+#elif PLATFORM(IOS_FAMILY)
+#import <MobileCoreServices/LSAppLinkPriv.h>
+#elif PLATFORM(IOS)
+#import <MobileCoreServices/MobileCoreServicesPriv.h>
+#endif
+
 #endif // USE(APPLE_INTERNAL_SDK)
 
 #if HAVE(APP_LINKS)
@@ -77,22 +83,15 @@
 };
 #endif
 
-#if HAVE(LSDATABASECONTEXT)
-@interface LSDatabaseContext : NSObject
-@property (class, readonly) LSDatabaseContext *sharedDatabaseContext;
-@end
-#endif
-
 #endif // !USE(APPLE_INTERNAL_SDK)
 
-#if HAVE(LSDATABASECONTEXT)
-@interface LSDatabaseContext (WebKitChangeTracking)
-- (id <NSObject>)addDatabaseChangeObserver4WebKit:(void (^)(xpc_object_t change))observer;
-- (void)removeDatabaseChangeObserver4WebKit:(id <NSObject>)token;
-- (void)observeDatabaseChange4WebKit:(xpc_object_t)change;
+@interface _LSDService : NSObject <NSXPCListenerDelegate>
++ (NSXPCConnection *)XPCConnectionToService;
 @end
-#endif
 
+@interface _LSDReadService : _LSDService
+@end
+
 #if PLATFORM(MAC)
 
 typedef const struct CF_BRIDGED_TYPE(id) __LSASN* LSASNRef;

Modified: trunk/Source/WebKit/ChangeLog (264166 => 264167)


--- trunk/Source/WebKit/ChangeLog	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/ChangeLog	2020-07-09 14:02:14 UTC (rev 264167)
@@ -1,3 +1,17 @@
+2020-07-09  Commit Queue  <[email protected]>
+
+        Unreviewed, reverting r264148.
+        https://bugs.webkit.org/show_bug.cgi?id=214136
+
+        Introduced layout test failures
+
+        Reverted changeset:
+
+        "[Cocoa] Update Launch Services database in the WebContent
+        process from the Network process"
+        https://bugs.webkit.org/show_bug.cgi?id=213794
+        https://trac.webkit.org/changeset/264148
+
 2020-07-09  Carlos Garcia Campos  <[email protected]>
 
         [SOUP] Add support for HTTPCookieAcceptPolicy::OnlyFromMainDocumentDomain

Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp (264166 => 264167)


--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp	2020-07-09 14:02:14 UTC (rev 264167)
@@ -97,7 +97,6 @@
 #include "NetworkCacheCoders.h"
 
 #if PLATFORM(COCOA)
-#include "LaunchServicesDatabaseObserver.h"
 #include "NetworkSessionCocoa.h"
 #endif
 
@@ -164,9 +163,6 @@
 #if ENABLE(LEGACY_CUSTOM_PROTOCOL_MANAGER)
     addSupplement<LegacyCustomProtocolManager>();
 #endif
-#if PLATFORM(COCOA)
-    addSupplement<LaunchServicesDatabaseObserver>();
-#endif
 #if PLATFORM(COCOA) && ENABLE(LEGACY_CUSTOM_PROTOCOL_MANAGER)
     LegacyCustomProtocolManager::networkProcessCreated(*this);
 #endif

Deleted: trunk/Source/WebKit/NetworkProcess/cocoa/LaunchServicesDatabaseObserver.h (264166 => 264167)


--- trunk/Source/WebKit/NetworkProcess/cocoa/LaunchServicesDatabaseObserver.h	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/LaunchServicesDatabaseObserver.h	2020-07-09 14:02:14 UTC (rev 264167)
@@ -1,60 +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 "NetworkProcess.h"
-#include "NetworkProcessSupplement.h"
-#include <WebCore/XPCEndpoint.h>
-#include <wtf/OSObjectPtr.h>
-#include <wtf/RetainPtr.h>
-
-namespace WebKit {
-
-class LaunchServicesDatabaseObserver : public WebCore::XPCEndpoint, public NetworkProcessSupplement {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    LaunchServicesDatabaseObserver(NetworkProcess&);
-    virtual ~LaunchServicesDatabaseObserver();
-
-    static const char* supplementName();
-
-private:
-    void startObserving(OSObjectPtr<xpc_connection_t>);
-
-    // XPCEndpoint
-    const char* xpcEndpointMessageNameKey() const override;
-    const char* xpcEndpointMessageName() const override;
-    const char* xpcEndpointNameKey() const override;
-    void handleEvent(xpc_connection_t, xpc_object_t) override;
-
-    // NetworkProcessSupplement
-    void initializeConnection(IPC::Connection*) final;
-
-    RetainPtr<id> m_observer;
-    Vector<OSObjectPtr<xpc_connection_t>> m_connections;
-};
-
-}

Deleted: trunk/Source/WebKit/NetworkProcess/cocoa/LaunchServicesDatabaseObserver.mm (264166 => 264167)


--- trunk/Source/WebKit/NetworkProcess/cocoa/LaunchServicesDatabaseObserver.mm	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/LaunchServicesDatabaseObserver.mm	2020-07-09 14:02:14 UTC (rev 264167)
@@ -1,150 +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 "LaunchServicesDatabaseObserver.h"
-
-#import "LaunchServicesDatabaseXPCConstants.h"
-#import <pal/spi/cocoa/LaunchServicesSPI.h>
-#import <wtf/cocoa/Entitlements.h>
-#import <wtf/spi/cocoa/SecuritySPI.h>
-
-namespace WebKit {
-
-#if HAVE(LSDATABASECONTEXT)
-static LSDatabaseContext *databaseContext()
-{
-    static dispatch_once_t once;
-    static LSDatabaseContext *context = nullptr;
-    dispatch_once(&once, ^{
-        context = [NSClassFromString(@"LSDatabaseContext") sharedDatabaseContext];
-    });
-    return context;
-}
-#endif
-
-LaunchServicesDatabaseObserver::LaunchServicesDatabaseObserver(NetworkProcess&)
-{
-#if HAVE(LSDATABASECONTEXT)
-    if (![databaseContext() respondsToSelector:@selector(addDatabaseChangeObserver4WebKit:)])
-        return;
-
-    m_observer = [databaseContext() addDatabaseChangeObserver4WebKit:^(xpc_object_t change) {
-        auto message = adoptOSObject(xpc_dictionary_create(nullptr, nullptr, 0));
-        xpc_dictionary_set_string(message.get(), XPCEndpoint::xpcMessageNameKey, LaunchServicesDatabaseXPCConstants::xpcUpdateLaunchServicesDatabaseMessageName);
-        xpc_dictionary_set_value(message.get(), LaunchServicesDatabaseXPCConstants::xpcLaunchServicesDatabaseKey, change);
-
-        for (auto& connection : m_connections)
-            xpc_connection_send_message(connection.get(), message.get());
-    }];
-#endif
-}
-
-const char* LaunchServicesDatabaseObserver::supplementName()
-{
-    return "LaunchServicesDatabaseObserverSupplement";
-}
-
-void LaunchServicesDatabaseObserver::startObserving(OSObjectPtr<xpc_connection_t> connection)
-{
-    m_connections.append(connection);
-
-#if HAVE(LSDATABASECONTEXT)
-    if (![databaseContext() respondsToSelector:@selector(addDatabaseChangeObserver4WebKit:)]) {
-        auto message = adoptOSObject(xpc_dictionary_create(nullptr, nullptr, 0));
-        xpc_dictionary_set_string(message.get(), XPCEndpoint::xpcMessageNameKey, LaunchServicesDatabaseXPCConstants::xpcUpdateLaunchServicesDatabaseMessageName);
-        xpc_connection_send_message(connection.get(), message.get());
-        return;
-    }
-
-    RetainPtr<id> observer = [databaseContext() addDatabaseChangeObserver4WebKit:^(xpc_object_t change) {
-        auto message = adoptOSObject(xpc_dictionary_create(nullptr, nullptr, 0));
-        xpc_dictionary_set_string(message.get(), XPCEndpoint::xpcMessageNameKey, LaunchServicesDatabaseXPCConstants::xpcUpdateLaunchServicesDatabaseMessageName);
-        xpc_dictionary_set_value(message.get(), LaunchServicesDatabaseXPCConstants::xpcLaunchServicesDatabaseKey, change);
-
-        xpc_connection_send_message(connection.get(), message.get());
-    }];
-
-    [databaseContext() removeDatabaseChangeObserver4WebKit:observer.get()];
-#else
-    auto message = adoptOSObject(xpc_dictionary_create(nullptr, nullptr, 0));
-    xpc_dictionary_set_string(message.get(), XPCEndpoint::xpcMessageNameKey, LaunchServicesDatabaseXPCConstants::xpcUpdateLaunchServicesDatabaseMessageName);
-    xpc_connection_send_message(connection.get(), message.get());
-#endif
-}
-
-LaunchServicesDatabaseObserver::~LaunchServicesDatabaseObserver()
-{
-#if HAVE(LSDATABASECONTEXT)
-    if (![databaseContext() respondsToSelector:@selector(removeDatabaseChangeObserver4WebKit:)])
-        return;
-
-    [databaseContext() removeDatabaseChangeObserver4WebKit:m_observer.get()];
-#endif
-}
-
-const char* LaunchServicesDatabaseObserver::xpcEndpointMessageNameKey() const
-{
-    return xpcMessageNameKey;
-}
-
-const char* LaunchServicesDatabaseObserver::xpcEndpointMessageName() const
-{
-    return LaunchServicesDatabaseXPCConstants::xpcLaunchServicesDatabaseXPCEndpointMessageName;
-}
-
-const char* LaunchServicesDatabaseObserver::xpcEndpointNameKey() const
-{
-    return LaunchServicesDatabaseXPCConstants::xpcLaunchServicesDatabaseXPCEndpointNameKey;
-}
-
-void LaunchServicesDatabaseObserver::handleEvent(xpc_connection_t connection, xpc_object_t event)
-{
-    if (xpc_get_type(event) == XPC_TYPE_ERROR) {
-        if (event != XPC_ERROR_CONNECTION_INVALID && event != XPC_ERROR_TERMINATION_IMMINENT)
-            return;
-
-        for (size_t i = 0; i < m_connections.size(); i++) {
-            if (m_connections[i].get() == connection) {
-                m_connections.remove(i);
-                break;
-            }
-        }
-        return;
-    }
-    if (xpc_get_type(event) == XPC_TYPE_DICTIONARY) {
-        String messageName = xpc_dictionary_get_string(event, xpcMessageNameKey);
-        if (messageName != LaunchServicesDatabaseXPCConstants::xpcRequestLaunchServicesDatabaseUpdateMessageName)
-            return;
-        startObserving(connection);
-    }
-}
-
-void LaunchServicesDatabaseObserver::initializeConnection(IPC::Connection* connection)
-{
-    sendEndpointToConnection(connection->xpcConnection());
-}
-
-}

Modified: trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb (264166 => 264167)


--- trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb	2020-07-09 14:02:14 UTC (rev 264167)
@@ -588,7 +588,7 @@
 (allow ipc-posix-shm-read*
        (ipc-posix-name-prefix "apple.cfprefs."))
  
-(deny mach-lookup
+(allow mach-lookup
     (global-name "com.apple.lsd.mapdb"))
 
 ;; <rdar://problem/12413942>

Modified: trunk/Source/WebKit/Scripts/process-entitlements.sh (264166 => 264167)


--- trunk/Source/WebKit/Scripts/process-entitlements.sh	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/Scripts/process-entitlements.sh	2020-07-09 14:02:14 UTC (rev 264167)
@@ -15,7 +15,6 @@
 
     if [[ "${WK_USE_RESTRICTED_ENTITLEMENTS}" == YES ]]
     then
-        plistbuddy Add :com.apple.private.webkit.use-xpc-endpoint bool YES
         plistbuddy Add :com.apple.rootless.storage.WebKitWebContentSandbox bool YES
     fi
 
@@ -52,7 +51,6 @@
             plistbuddy Add :com.apple.private.tcc.manager.check-by-audit-token:0 string kTCCServiceWebKitIntelligentTrackingPrevention
         fi
 
-        plistbuddy Add :com.apple.private.webkit.use-xpc-endpoint bool YES
         plistbuddy Add :com.apple.rootless.storage.WebKitNetworkingSandbox bool YES
     fi
 }
@@ -146,7 +144,6 @@
     plistbuddy Add :com.apple.private.security.message-filter bool YES
     plistbuddy Add :com.apple.private.webinspector.allow-remote-inspection bool YES
     plistbuddy Add :com.apple.private.webinspector.proxy-application bool YES
-    plistbuddy Add :com.apple.private.webkit.use-xpc-endpoint bool YES
     plistbuddy Add :com.apple.runningboard.assertions.webkit bool YES
     plistbuddy Add :dynamic-codesigning bool YES
 
@@ -187,7 +184,6 @@
     plistbuddy Add :com.apple.private.dmd.policy bool YES
     plistbuddy Add :com.apple.private.memorystatus bool YES
     plistbuddy Add :com.apple.private.network.socket-delegate bool YES
-    plistbuddy Add :com.apple.private.webkit.use-xpc-endpoint bool YES
     plistbuddy Add :com.apple.runningboard.assertions.webkit bool YES
 
     plistbuddy Add :com.apple.private.tcc.manager.check-by-audit-token array

Deleted: trunk/Source/WebKit/Shared/Cocoa/LaunchServicesDatabaseXPCConstants.h (264166 => 264167)


--- trunk/Source/WebKit/Shared/Cocoa/LaunchServicesDatabaseXPCConstants.h	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/Shared/Cocoa/LaunchServicesDatabaseXPCConstants.h	2020-07-09 14:02:14 UTC (rev 264167)
@@ -1,39 +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
-
-namespace WebKit {
-
-namespace LaunchServicesDatabaseXPCConstants {
-
-constexpr auto xpcUpdateLaunchServicesDatabaseMessageName = "update-launch-services-database-message";
-constexpr auto xpcLaunchServicesDatabaseKey = "launch-services-database";
-constexpr auto xpcRequestLaunchServicesDatabaseUpdateMessageName = "request-launch-services-database-update-message";
-constexpr auto xpcLaunchServicesDatabaseXPCEndpointNameKey = "xpc-endpoint-launch-services-database";
-constexpr auto xpcLaunchServicesDatabaseXPCEndpointMessageName = "xpc-endpoint-launch-services-database-message";
-} // namespace LaunchServicesDatabaseXPCConstants
-
-} // namespace WebKit

Modified: trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm (264166 => 264167)


--- trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm	2020-07-09 14:02:14 UTC (rev 264167)
@@ -29,7 +29,6 @@
 
 #import <CoreFoundation/CoreFoundation.h>
 #import <pal/spi/cf/CFUtilitiesSPI.h>
-#import <pal/spi/cocoa/LaunchServicesSPI.h>
 #import <wtf/OSObjectPtr.h>
 #import <wtf/RetainPtr.h>
 #import <wtf/spi/darwin/XPCSPI.h>

Modified: trunk/Source/WebKit/SourcesCocoa.txt (264166 => 264167)


--- trunk/Source/WebKit/SourcesCocoa.txt	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/SourcesCocoa.txt	2020-07-09 14:02:14 UTC (rev 264167)
@@ -415,8 +415,6 @@
 UIProcess/Inspector/mac/WKInspectorViewController.mm
 UIProcess/Inspector/mac/WKInspectorWKWebView.mm
 
-UIProcess/Network/NetworkProcessProxyCocoa.mm
-
 UIProcess/ios/forms/WKAirPlayRoutePicker.mm
 UIProcess/ios/forms/WKDatePickerViewController.mm
 UIProcess/ios/forms/WKDateTimeInputControl.mm

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (264166 => 264167)


--- trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2020-07-09 14:02:14 UTC (rev 264167)
@@ -934,23 +934,4 @@
 }
 #endif
 
-OSObjectPtr<xpc_object_t> WebProcessPool::xpcEndpointMessage() const
-{
-    return m_endpointMessage;
-}
-
-void WebProcessPool::sendNetworkProcessXPCEndpointToWebProcess(OSObjectPtr<xpc_object_t> endpointMessage)
-{
-    m_endpointMessage = endpointMessage;
-
-    for (auto process : m_processes) {
-        if (process->state() != AuxiliaryProcessProxy::State::Running)
-            continue;
-        if (!process->connection())
-            continue;
-        auto connection = process->connection()->xpcConnection();
-        xpc_connection_send_message(connection, endpointMessage.get());
-    }
-}
-
 } // namespace WebKit

Deleted: trunk/Source/WebKit/UIProcess/Cocoa/XPCEventHandler.h (264166 => 264167)


--- trunk/Source/WebKit/UIProcess/Cocoa/XPCEventHandler.h	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/UIProcess/Cocoa/XPCEventHandler.h	2020-07-09 14:02:14 UTC (rev 264167)
@@ -1,39 +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/ThreadSafeRefCounted.h>
-
-namespace WebKit {
-
-class XPCEventHandler : public ThreadSafeRefCounted<XPCEventHandler> {
-public:
-    virtual ~XPCEventHandler() { }
-
-    virtual bool handleXPCEvent(xpc_object_t) const = 0;
-};
-
-}

Modified: trunk/Source/WebKit/UIProcess/Launcher/ProcessLauncher.h (264166 => 264167)


--- trunk/Source/WebKit/UIProcess/Launcher/ProcessLauncher.h	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/UIProcess/Launcher/ProcessLauncher.h	2020-07-09 14:02:14 UTC (rev 264167)
@@ -39,10 +39,6 @@
 #include <wtf/win/Win32Handle.h>
 #endif
 
-#if PLATFORM(COCOA)
-#include "XPCEventHandler.h"
-#endif
-
 namespace WebKit {
 
 #if PLATFORM(GTK) || PLATFORM(WPE)
@@ -61,9 +57,6 @@
         virtual void didFinishLaunching(ProcessLauncher*, IPC::Connection::Identifier) = 0;
         virtual bool shouldConfigureJSCForTesting() const { return false; }
         virtual bool isJITEnabled() const { return true; }
-#if PLATFORM(COCOA)
-        virtual RefPtr<XPCEventHandler> xpcEventHandler() const { return nullptr; }
-#endif
     };
     
     enum class ProcessType {

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


--- trunk/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm	2020-07-09 14:02:14 UTC (rev 264167)
@@ -238,28 +238,18 @@
         processLauncher->didFinishLaunchingProcess(0, IPC::Connection::Identifier());
     };
 
-    auto eventHandler = [errorHandlerImpl = WTFMove(errorHandlerImpl), eventHandler = m_client->xpcEventHandler()] (xpc_object_t event) mutable {
-
-        if (!event || xpc_get_type(event) == XPC_TYPE_ERROR) {
-            RunLoop::main().dispatch([errorHandlerImpl = WTFMove(errorHandlerImpl), event = OSObjectPtr(event)] {
-                errorHandlerImpl(event.get());
-            });
-            return;
-        }
-
-        if (eventHandler) {
-            RunLoop::main().dispatch([eventHandler = eventHandler, event = OSObjectPtr(event)] {
-                eventHandler->handleXPCEvent(event.get());
-            });
-        }
+    auto errorHandler = [errorHandlerImpl = WTFMove(errorHandlerImpl)] (xpc_object_t event) mutable {
+        RunLoop::main().dispatch([errorHandlerImpl = WTFMove(errorHandlerImpl), event] {
+            errorHandlerImpl(event);
+        });
     };
 
-    xpc_connection_set_event_handler(m_xpcConnection.get(), eventHandler);
+    xpc_connection_set_event_handler(m_xpcConnection.get(), errorHandler);
 
     xpc_connection_resume(m_xpcConnection.get());
 
     if (UNLIKELY(m_launchOptions.shouldMakeProcessLaunchFailForTesting)) {
-        eventHandler(nullptr);
+        errorHandler(nullptr);
         return;
     }
 

Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h (264166 => 264167)


--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h	2020-07-09 14:02:14 UTC (rev 264167)
@@ -44,10 +44,6 @@
 #include "LegacyCustomProtocolManagerProxy.h"
 #endif
 
-#if PLATFORM(COCOA)
-#include "XPCEventHandler.h"
-#endif
-
 namespace IPC {
 class FormDataReference;
 }
@@ -301,9 +297,6 @@
 
     // ProcessLauncher::Client
     void didFinishLaunching(ProcessLauncher*, IPC::Connection::Identifier) override;
-#if PLATFORM(COCOA)
-    RefPtr<XPCEventHandler> xpcEventHandler() const override;
-#endif
 
     void processAuthenticationChallenge(PAL::SessionID, Ref<AuthenticationChallengeProxy>&&);
 
@@ -334,18 +327,6 @@
         HashMap<WebCore::ProcessIdentifier, std::unique_ptr<ProcessAssertion>> webProcessAssertions;
     };
     Optional<UploadActivity> m_uploadActivity;
-
-#if PLATFORM(COCOA)
-    class XPCEventHandler : public WebKit::XPCEventHandler {
-    public:
-        XPCEventHandler(const NetworkProcessProxy&);
-
-        bool handleXPCEvent(xpc_object_t) const override;
-
-    private:
-        WeakPtr<NetworkProcessProxy> m_networkProcess;
-    };
-#endif
 };
 
 } // namespace WebKit

Deleted: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxyCocoa.mm (264166 => 264167)


--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxyCocoa.mm	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxyCocoa.mm	2020-07-09 14:02:14 UTC (rev 264167)
@@ -1,65 +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 "NetworkProcessProxy.h"
-
-#import "LaunchServicesDatabaseXPCConstants.h"
-#import "WebProcessPool.h"
-#import <WebCore/XPCEndpoint.h>
-
-namespace WebKit {
-
-using namespace WebCore;
-
-RefPtr<XPCEventHandler> NetworkProcessProxy::xpcEventHandler() const
-{
-    return adoptRef(new NetworkProcessProxy::XPCEventHandler(*this));
-}
-
-bool NetworkProcessProxy::XPCEventHandler::handleXPCEvent(xpc_object_t event) const
-{
-    if (!m_networkProcess)
-        return false;
-
-    if (!event || xpc_get_type(event) == XPC_TYPE_ERROR)
-        return false;
-
-    String messageName = xpc_dictionary_get_string(event, XPCEndpoint::xpcMessageNameKey);
-    if (messageName.isEmpty())
-        return false;
-
-    if (messageName == LaunchServicesDatabaseXPCConstants::xpcLaunchServicesDatabaseXPCEndpointMessageName)
-        m_networkProcess->processPool().sendNetworkProcessXPCEndpointToWebProcess(event);
-
-    return true;
-}
-
-NetworkProcessProxy::XPCEventHandler::XPCEventHandler(const NetworkProcessProxy& networkProcess)
-    : m_networkProcess(makeWeakPtr(networkProcess))
-{
-}
-
-}

Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.h (264166 => 264167)


--- trunk/Source/WebKit/UIProcess/WebProcessPool.h	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.h	2020-07-09 14:02:14 UTC (rev 264167)
@@ -389,7 +389,7 @@
 
     // Network Process Management
     NetworkProcessProxy& ensureNetworkProcess(WebsiteDataStore* withWebsiteDataStore = nullptr);
-    NetworkProcessProxy* networkProcess() const { return m_networkProcess.get(); }
+    NetworkProcessProxy* networkProcess() { return m_networkProcess.get(); }
     void networkProcessCrashed(NetworkProcessProxy&);
 
     void getNetworkProcessConnection(WebProcessProxy&, Messages::WebProcessProxy::GetNetworkProcessConnectionDelayedReply&&);
@@ -541,11 +541,6 @@
     int32_t userId() const { return m_userId; }
 #endif
 
-#if PLATFORM(COCOA)
-    OSObjectPtr<xpc_object_t> xpcEndpointMessage() const;
-    void sendNetworkProcessXPCEndpointToWebProcess(OSObjectPtr<xpc_object_t> endpointMessage);
-#endif
-
 private:
     void platformInitialize();
 
@@ -830,10 +825,6 @@
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
     HashSet<WebCore::RegistrableDomain> m_domainsWithUserInteraction;
 #endif
-
-#if PLATFORM(COCOA)
-    OSObjectPtr<xpc_object_t> m_endpointMessage;
-#endif
 };
 
 template<typename T>

Modified: trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp (264166 => 264167)


--- trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp	2020-07-09 14:02:14 UTC (rev 264167)
@@ -953,12 +953,6 @@
         return;
     }
 
-#if PLATFORM(COCOA)
-    auto endpointMessage = processPool().xpcEndpointMessage();
-    if (endpointMessage)
-        xpc_connection_send_message(connection()->xpcConnection(), endpointMessage.get());
-#endif
-
     RELEASE_ASSERT(!m_webConnection);
     m_webConnection = WebConnectionToWebProcess::create(this);
 

Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (264166 => 264167)


--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2020-07-09 14:02:14 UTC (rev 264167)
@@ -1684,11 +1684,8 @@
 		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 */; };
-		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 */; };
-		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 */; };
 		C1E123BA20A11573002646F4 /* PDFContextMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = C1E123B920A11572002646F4 /* PDFContextMenu.h */; };
 		C517388112DF8F4F00EE3F47 /* DragControllerAction.h in Headers */ = {isa = PBXBuildFile; fileRef = C517388012DF8F4F00EE3F47 /* DragControllerAction.h */; };
@@ -5021,13 +5018,7 @@
 		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>"; };
-		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>"; };
-		C1663E5A24AEA74200C6A3B2 /* LaunchServicesDatabaseXPCConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LaunchServicesDatabaseXPCConstants.h; sourceTree = "<group>"; };
-		C1710CF224A7BD0300D7C112 /* XPCEventHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPCEventHandler.h; sourceTree = "<group>"; };
-		C1710CF524AA634500D7C112 /* LaunchServicesDatabaseObserver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LaunchServicesDatabaseObserver.h; sourceTree = "<group>"; };
-		C1710CF624AA643200D7C112 /* LaunchServicesDatabaseObserver.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = LaunchServicesDatabaseObserver.mm; sourceTree = "<group>"; };
 		C181735E205839F600DFDA65 /* DrawingAreaMac.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DrawingAreaMac.cpp; sourceTree = "<group>"; };
 		C18173602058424700DFDA65 /* DisplayLink.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DisplayLink.h; sourceTree = "<group>"; };
 		C1817362205844A900DFDA65 /* DisplayLink.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DisplayLink.cpp; sourceTree = "<group>"; };
@@ -5034,7 +5025,6 @@
 		C18FB51D242F9F76007E9875 /* WebSleepDisablerClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSleepDisablerClient.cpp; sourceTree = "<group>"; };
 		C18FB51E242F9F77007E9875 /* WebSleepDisablerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSleepDisablerClient.h; sourceTree = "<group>"; };
 		C1E123B920A11572002646F4 /* PDFContextMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PDFContextMenu.h; sourceTree = "<group>"; };
-		C1ED723724A5690E003F6CD3 /* NetworkProcessProxyCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = NetworkProcessProxyCocoa.mm; sourceTree = "<group>"; };
 		C517388012DF8F4F00EE3F47 /* DragControllerAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DragControllerAction.h; sourceTree = "<group>"; };
 		C5237F5F12441CA300780472 /* WebEditorClientMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebEditorClientMac.mm; sourceTree = "<group>"; };
 		C54256AF18BEC18B00DE4179 /* WKDateTimeInputControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKDateTimeInputControl.h; path = ios/forms/WKDateTimeInputControl.h; sourceTree = "<group>"; };
@@ -6394,7 +6384,6 @@
 				2D7AAFD218C8640600A7ACD4 /* WKWebViewContentProvider.h */,
 				2DC6D9C118C44A610043BAD4 /* WKWebViewContentProviderRegistry.h */,
 				2DC6D9C218C44A610043BAD4 /* WKWebViewContentProviderRegistry.mm */,
-				C1710CF224A7BD0300D7C112 /* XPCEventHandler.h */,
 			);
 			path = Cocoa;
 			sourceTree = "<group>";
@@ -7492,7 +7481,6 @@
 				C55F916D1C595E440029E92D /* DataDetectionResult.mm */,
 				CE550E132283744400D28791 /* InsertTextOptions.cpp */,
 				CE550E12228373C800D28791 /* InsertTextOptions.h */,
-				C1663E5A24AEA74200C6A3B2 /* LaunchServicesDatabaseXPCConstants.h */,
 				2D1087621D2C641B00B85F82 /* LoadParametersCocoa.mm */,
 				CD2865EC2255562000606AC7 /* ProcessTaskStateObserver.h */,
 				CD2865ED2255562000606AC7 /* ProcessTaskStateObserver.mm */,
@@ -7856,7 +7844,6 @@
 		510CC7E716138E7200D03ED3 /* Network */ = {
 			isa = PBXGroup;
 			children = (
-				C1ED723624A568F5003F6CD3 /* cocoa */,
 				29AD3091164B4C100072DEA9 /* CustomProtocols */,
 				516319931628980E00E22F00 /* mac */,
 				510CC7EA16138E7200D03ED3 /* NetworkProcessProxy.cpp */,
@@ -8387,8 +8374,6 @@
 			children = (
 				CD4570CB2440FB2A00A3DCEB /* AudioSessionRoutingArbitrator.cpp */,
 				CD4570CA2440FB2A00A3DCEB /* AudioSessionRoutingArbitrator.h */,
-				C14D37FC24ACDF45007FF014 /* LaunchServicesDatabaseManager.h */,
-				C14D37FD24ACE086007FF014 /* LaunchServicesDatabaseManager.mm */,
 				446DC64B24A2D8AD0061F390 /* PlaybackSessionContextIdentifier.h */,
 				CDA29A191CBDBF4100901CCF /* PlaybackSessionManager.h */,
 				CDA29A1C1CBDBF5B00901CCF /* PlaybackSessionManager.messages.in */,
@@ -8440,8 +8425,6 @@
 			children = (
 				2D0C56FB229F1DEA00BD33E7 /* DeviceManagementSoftLink.h */,
 				2D0C56FC229F1DEA00BD33E7 /* DeviceManagementSoftLink.mm */,
-				C1710CF524AA634500D7C112 /* LaunchServicesDatabaseObserver.h */,
-				C1710CF624AA643200D7C112 /* LaunchServicesDatabaseObserver.mm */,
 				5315876B2076B713004BF9F3 /* NetworkActivityTrackerCocoa.mm */,
 				5321594F1DBAE6D70054AA3C /* NetworkDataTaskCocoa.h */,
 				5CBC9B8B1C65257300A8FDCF /* NetworkDataTaskCocoa.mm */,
@@ -10269,14 +10252,6 @@
 			tabWidth = 8;
 			usesTabs = 0;
 		};
-		C1ED723624A568F5003F6CD3 /* cocoa */ = {
-			isa = PBXGroup;
-			children = (
-				C1ED723724A5690E003F6CD3 /* NetworkProcessProxyCocoa.mm */,
-			);
-			name = cocoa;
-			sourceTree = "<group>";
-		};
 		C54256AE18BEC16100DE4179 /* forms */ = {
 			isa = PBXGroup;
 			children = (
@@ -10883,7 +10858,6 @@
 				2D4D2C811DF60BF3002EB10C /* InteractionInformationRequest.h in Headers */,
 				1AE49A4911FFA8CE0048B464 /* JSNPMethod.h in Headers */,
 				1AE4987811FF7FAA0048B464 /* JSNPObject.h in Headers */,
-				C1663E5B24AEAA2F00C6A3B2 /* LaunchServicesDatabaseXPCConstants.h in Headers */,
 				BCE0937814FB128C001138D9 /* LayerHostingContext.h in Headers */,
 				1A92DC1112F8BA460017AF65 /* LayerTreeContext.h in Headers */,
 				44E936FD2447C2D8009FA3E3 /* LegacyCustomProtocolID.h in Headers */,
@@ -12752,8 +12726,6 @@
 				2749F6452146561E008380BF /* InjectedBundleRangeHandle.cpp in Sources */,
 				2D913441212CF9F000128AFD /* JSNPMethod.cpp in Sources */,
 				2D913442212CF9F000128AFD /* JSNPObject.cpp in Sources */,
-				C14D37FE24ACE086007FF014 /* LaunchServicesDatabaseManager.mm in Sources */,
-				C1710CF724AA643200D7C112 /* LaunchServicesDatabaseObserver.mm in Sources */,
 				2984F588164BA095004BC0C6 /* LegacyCustomProtocolManagerMessageReceiver.cpp in Sources */,
 				2984F57C164B915F004BC0C6 /* LegacyCustomProtocolManagerProxyMessageReceiver.cpp in Sources */,
 				51F060E11654318500F3281C /* LibWebRTCNetworkMessageReceiver.cpp in Sources */,

Modified: trunk/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm (264166 => 264167)


--- trunk/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm	2020-07-09 14:02:14 UTC (rev 264167)
@@ -27,7 +27,6 @@
 #import "WebPage.h"
 
 #import "InsertTextOptions.h"
-#import "LaunchServicesDatabaseManager.h"
 #import "LoadParameters.h"
 #import "PluginView.h"
 #import "WKAccessibilityWebPageObjectBase.h"
@@ -63,9 +62,6 @@
 
 void WebPage::platformDidReceiveLoadParameters(const LoadParameters& parameters)
 {
-    bool databaseUpdated =  LaunchServicesDatabaseManager::singleton().waitForDatabaseUpdate(5_s);
-    ASSERT_UNUSED(databaseUpdated, databaseUpdated);
-
     m_dataDetectionContext = parameters.dataDetectionContext;
 
     if (parameters.neHelperExtensionHandle)

Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (264166 => 264167)


--- trunk/Source/WebKit/WebProcess/WebProcess.cpp	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp	2020-07-09 14:02:14 UTC (rev 264167)
@@ -290,10 +290,6 @@
 {
     AuxiliaryProcess::initializeConnection(connection);
 
-#if PLATFORM(COCOA)
-    handleXPCEndpointMessages();
-#endif
-
     // We call _exit() directly from the background queue in case the main thread is unresponsive
     // and AuxiliaryProcess::didClose() does not get called.
     connection->setDidCloseOnConnectionWorkQueueCallback(callExit);

Modified: trunk/Source/WebKit/WebProcess/WebProcess.h (264166 => 264167)


--- trunk/Source/WebKit/WebProcess/WebProcess.h	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/WebProcess/WebProcess.h	2020-07-09 14:02:14 UTC (rev 264167)
@@ -515,10 +515,6 @@
 
     bool isAlwaysOnLoggingAllowed() { return m_sessionID ? m_sessionID->isAlwaysOnLoggingAllowed() : true; }
 
-#if PLATFORM(COCOA)
-    void handleXPCEndpointMessages() const;
-#endif
-
     RefPtr<WebConnectionToUIProcess> m_webConnection;
 
     HashMap<WebCore::PageIdentifier, RefPtr<WebPage>> m_pageMap;

Deleted: trunk/Source/WebKit/WebProcess/cocoa/LaunchServicesDatabaseManager.h (264166 => 264167)


--- trunk/Source/WebKit/WebProcess/cocoa/LaunchServicesDatabaseManager.h	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/WebProcess/cocoa/LaunchServicesDatabaseManager.h	2020-07-09 14:02:14 UTC (rev 264167)
@@ -1,48 +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
-
-#import <WebCore/XPCEndpointClient.h>
-#import <wtf/NeverDestroyed.h>
-#import <wtf/threads/BinarySemaphore.h>
-
-namespace WebKit {
-
-class LaunchServicesDatabaseManager : public WebCore::XPCEndpointClient {
-public:
-    static LaunchServicesDatabaseManager& singleton();
-
-    bool waitForDatabaseUpdate(Seconds);
-
-private:
-    void handleEvent(xpc_object_t) override;
-    void didConnect() override;
-
-    std::atomic<bool> m_hasReceivedLaunchServicesDatabase { false };
-    BinarySemaphore m_semaphore;
-};
-
-}

Deleted: trunk/Source/WebKit/WebProcess/cocoa/LaunchServicesDatabaseManager.mm (264166 => 264167)


--- trunk/Source/WebKit/WebProcess/cocoa/LaunchServicesDatabaseManager.mm	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/WebProcess/cocoa/LaunchServicesDatabaseManager.mm	2020-07-09 14:02:14 UTC (rev 264167)
@@ -1,82 +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 "LaunchServicesDatabaseManager.h"
-
-#import "LaunchServicesDatabaseXPCConstants.h"
-#import <WebCore/XPCEndpoint.h>
-#import <pal/spi/cocoa/LaunchServicesSPI.h>
-#import <wtf/cocoa/Entitlements.h>
-#import <wtf/spi/darwin/XPCSPI.h>
-#import <wtf/text/WTFString.h>
-
-namespace WebKit {
-
-using namespace WebCore;
-
-LaunchServicesDatabaseManager& LaunchServicesDatabaseManager::singleton()
-{
-    static NeverDestroyed<LaunchServicesDatabaseManager> manager;
-    return manager.get();
-}
-
-void LaunchServicesDatabaseManager::handleEvent(xpc_object_t message)
-{
-    String messageName = xpc_dictionary_get_string(message, XPCEndpoint::xpcMessageNameKey);
-    if (messageName.isEmpty())
-        return;
-    if (messageName == LaunchServicesDatabaseXPCConstants::xpcUpdateLaunchServicesDatabaseMessageName) {
-#if HAVE(LSDATABASECONTEXT)
-        auto database = xpc_dictionary_get_value(message, LaunchServicesDatabaseXPCConstants::xpcLaunchServicesDatabaseKey);
-
-        if (database) {
-            auto context = [NSClassFromString(@"LSDatabaseContext") sharedDatabaseContext];
-            if (![context respondsToSelector:@selector(observeDatabaseChange4WebKit:)])
-                return;
-            [context observeDatabaseChange4WebKit:database];
-        }
-#endif
-        m_semaphore.signal();
-        m_hasReceivedLaunchServicesDatabase = true;
-    }
-}
-
-void LaunchServicesDatabaseManager::didConnect()
-{
-    auto message = adoptOSObject(xpc_dictionary_create(nullptr, nullptr, 0));
-    xpc_dictionary_set_string(message.get(), XPCEndpoint::xpcMessageNameKey, LaunchServicesDatabaseXPCConstants::xpcRequestLaunchServicesDatabaseUpdateMessageName);
-
-    xpc_connection_send_message(connection().get(), message.get());
-}
-
-bool LaunchServicesDatabaseManager::waitForDatabaseUpdate(Seconds timeout)
-{
-    if (m_hasReceivedLaunchServicesDatabase)
-        return true;
-    return m_semaphore.waitFor(timeout);
-}
-
-}

Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (264166 => 264167)


--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2020-07-09 12:30:22 UTC (rev 264166)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2020-07-09 14:02:14 UTC (rev 264167)
@@ -27,8 +27,6 @@
 #import "WebProcess.h"
 #import "WebProcessCocoa.h"
 
-#import "LaunchServicesDatabaseManager.h"
-#import "LaunchServicesDatabaseXPCConstants.h"
 #import "LegacyCustomProtocolManager.h"
 #import "LogInitialization.h"
 #import "Logging.h"
@@ -71,7 +69,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>
@@ -164,32 +161,25 @@
 }
 #endif
 
-void WebProcess::handleXPCEndpointMessages() const
+void WebProcess::platformInitializeWebProcess(WebProcessCreationParameters& parameters)
 {
-    if (!parentProcessConnection())
-        return;
+    // Map Launch Services database. This should be done as early as possible, as the mapping will fail
+    // if 'com.apple.lsd.mapdb' is being accessed before this.
+    if (parameters.mapDBExtensionHandle) {
+        auto extension = SandboxExtension::create(WTFMove(*parameters.mapDBExtensionHandle));
+        bool ok = extension->consume();
+        ASSERT_UNUSED(ok, ok);
+        // Perform API calls which will communicate with the database mapping service, and map the database.
+        auto uti = adoptCF(UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, CFSTR("text/html"), 0));
 
-    auto connection = parentProcessConnection()->xpcConnection();
+        [[objc_getClass("_LSDReadService") XPCConnectionToService] invalidate];
 
-    xpc_connection_set_target_queue(connection, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0));
-    xpc_connection_set_event_handler(connection, ^(xpc_object_t event) {
-        if (xpc_get_type(event) != XPC_TYPE_DICTIONARY)
-            return;
+        ok = extension->revoke();
+        ASSERT_UNUSED(ok, ok);
 
-        String messageName = xpc_dictionary_get_string(event, XPCEndpoint::xpcMessageNameKey);
-        if (messageName.isEmpty())
-            return;
+        ASSERT(String(uti.get()) == String(adoptCF(UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, CFSTR("text/html"), 0)).get()));
+    }
 
-        if (messageName == LaunchServicesDatabaseXPCConstants::xpcLaunchServicesDatabaseXPCEndpointMessageName) {
-            auto endpoint = xpc_dictionary_get_value(event, LaunchServicesDatabaseXPCConstants::xpcLaunchServicesDatabaseXPCEndpointNameKey);
-            LaunchServicesDatabaseManager::singleton().setEndpoint(endpoint);
-            return;
-        }
-    });
-}
-
-void WebProcess::platformInitializeWebProcess(WebProcessCreationParameters& parameters)
-{
 #if !LOG_DISABLED || !RELEASE_LOG_DISABLED
     WebCore::initializeLogChannelsIfNecessary(parameters.webCoreLoggingChannels);
     WebKit::initializeLogChannelsIfNecessary(parameters.webKitLoggingChannels);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to