Title: [241205] trunk/Source

Diff

Modified: trunk/Source/WTF/ChangeLog (241204 => 241205)


--- trunk/Source/WTF/ChangeLog	2019-02-08 20:36:07 UTC (rev 241204)
+++ trunk/Source/WTF/ChangeLog	2019-02-08 21:19:32 UTC (rev 241205)
@@ -1,3 +1,16 @@
+2019-02-08  Truitt Savell  <[email protected]>
+
+        Unreviewed, rolling out r241197.
+
+        Broke iOS Simulator Debug build and casued 1 API failure on
+        High Sierra
+
+        Reverted changeset:
+
+        "Add SPI to use networking daemon instead of XPC service"
+        https://bugs.webkit.org/show_bug.cgi?id=194427
+        https://trac.webkit.org/changeset/241197
+
 2019-02-08  Alex Christensen  <[email protected]>
 
         Add SPI to use networking daemon instead of XPC service

Modified: trunk/Source/WTF/wtf/spi/darwin/XPCSPI.h (241204 => 241205)


--- trunk/Source/WTF/wtf/spi/darwin/XPCSPI.h	2019-02-08 20:36:07 UTC (rev 241204)
+++ trunk/Source/WTF/wtf/spi/darwin/XPCSPI.h	2019-02-08 21:19:32 UTC (rev 241205)
@@ -152,6 +152,8 @@
 mach_port_t xpc_dictionary_copy_mach_send(xpc_object_t, const char*);
 void xpc_dictionary_set_mach_send(xpc_object_t, const char*, mach_port_t);
 
+void xpc_connection_set_bootstrap(xpc_connection_t, xpc_object_t bootstrap);
+xpc_object_t xpc_copy_bootstrap(void);
 void xpc_connection_set_oneshot_instance(xpc_connection_t, uuid_t instance);
 
 void xpc_array_append_value(xpc_object_t xarray, xpc_object_t value);
@@ -179,5 +181,3 @@
 #endif
 
 WTF_EXTERN_C_END
-
-#define XPC_CONNECTION_MACH_SERVICE_LISTENER (1 << 0)

Modified: trunk/Source/WebKit/ChangeLog (241204 => 241205)


--- trunk/Source/WebKit/ChangeLog	2019-02-08 20:36:07 UTC (rev 241204)
+++ trunk/Source/WebKit/ChangeLog	2019-02-08 21:19:32 UTC (rev 241205)
@@ -1,3 +1,16 @@
+2019-02-08  Truitt Savell  <[email protected]>
+
+        Unreviewed, rolling out r241197.
+
+        Broke iOS Simulator Debug build and casued 1 API failure on
+        High Sierra
+
+        Reverted changeset:
+
+        "Add SPI to use networking daemon instead of XPC service"
+        https://bugs.webkit.org/show_bug.cgi?id=194427
+        https://trac.webkit.org/changeset/241197
+
 2019-02-08  Beth Dakin  <[email protected]>
 
         Abstract and discussion comments needed for afterScreenUpdates

Modified: trunk/Source/WebKit/NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm (241204 => 241205)


--- trunk/Source/WebKit/NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm	2019-02-08 20:36:07 UTC (rev 241204)
+++ trunk/Source/WebKit/NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm	2019-02-08 21:19:32 UTC (rev 241205)
@@ -26,33 +26,11 @@
 #import "config.h"
 #import "DaemonEntryPoint.h"
 
-#import "XPCServiceEntryPoint.h"
-#import <wtf/spi/darwin/XPCSPI.h>
+namespace WebKit {
 
-namespace WebKit {
-    
-int DaemonMain(int argc, const char** argv)
+int DaemonMain(int, const char**)
 {
-    if (argc < 2 || strcmp(argv[1], "WebKitNetworkingDaemon")) {
-        WTFLogAlways("Unexpected daemon parameters");
-        return EXIT_FAILURE;
-    }
-
-    xpc_connection_t listener = xpc_connection_create_mach_service("com.apple.WebKit.NetworkingDaemon", dispatch_get_main_queue(), XPC_CONNECTION_MACH_SERVICE_LISTENER);
-    
-    xpc_connection_set_event_handler(listener, ^(xpc_object_t peer) {
-        if (!peer || xpc_get_type(peer) != XPC_TYPE_CONNECTION) {
-            WTFLogAlways("Unexpected XPC object");
-            return;
-        }
-
-        XPCEventHandler(peer, AuxiliaryProcessType::Daemon);
-    });
-
-    xpc_connection_resume(listener);
-    CFRunLoopRun();
-
-    return EXIT_SUCCESS;
+    return 0;
 }
 
 }

Modified: trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h (241204 => 241205)


--- trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h	2019-02-08 20:36:07 UTC (rev 241204)
+++ trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h	2019-02-08 21:19:32 UTC (rev 241205)
@@ -130,9 +130,6 @@
 
 int XPCServiceMain(int, const char**);
 
-enum class AuxiliaryProcessType { Daemon, XPCService };
-void XPCEventHandler(xpc_connection_t, AuxiliaryProcessType);
-
 void XPCServiceExit(OSObjectPtr<xpc_object_t>&& priorityBoostMessage);
 
 } // namespace WebKit

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


--- trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm	2019-02-08 20:36:07 UTC (rev 241204)
+++ trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm	2019-02-08 21:19:32 UTC (rev 241205)
@@ -38,9 +38,7 @@
 
 namespace WebKit {
 
-void XPCInitializationHandler(xpc_object_t);
-
-void XPCEventHandler(xpc_connection_t peer, AuxiliaryProcessType processType)
+static void XPCServiceEventHandler(xpc_connection_t peer)
 {
     static xpc_object_t priorityBoostMessage = nullptr;
 
@@ -49,20 +47,13 @@
         xpc_type_t type = xpc_get_type(event);
         if (type == XPC_TYPE_ERROR) {
             if (event == XPC_ERROR_CONNECTION_INVALID || event == XPC_ERROR_TERMINATION_IMMINENT) {
-                if (processType == AuxiliaryProcessType::XPCService) {
-                    // FIXME: Handle this case more gracefully.
-                    exit(EXIT_FAILURE);
-                } else {
-                    // FIXME: Deref the NetworkProcess object associated with this xpc connection
-                    // once we have a container for such objects.
-                }
+                // FIXME: Handle this case more gracefully.
+                exit(EXIT_FAILURE);
             }
         } else {
             assert(type == XPC_TYPE_DICTIONARY);
 
             if (!strcmp(xpc_dictionary_get_string(event, "message-name"), "bootstrap")) {
-                XPCInitializationHandler(xpc_dictionary_get_value(event, "initialization-message"));
-                
                 CFBundleRef webKitBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.WebKit"));
                 CFStringRef entryPointFunctionName = (CFStringRef)CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle(), CFSTR("WebKitEntryPoint"));
 
@@ -101,10 +92,8 @@
     xpc_connection_resume(peer);
 }
 
-void XPCInitializationHandler(xpc_object_t event)
+int XPCServiceMain(int, const char**)
 {
-    ASSERT(event);
-    ASSERT(xpc_get_type(event) == XPC_TYPE_DICTIONARY);
 #if defined(__i386__)
     // FIXME: This should only be done for the 32-bit plug-in XPC service so we rely on the fact that
     // it's the only of the XPC services that are 32-bit. We should come up with a more targeted #if check.
@@ -115,8 +104,9 @@
     }
 #endif
 
+    auto bootstrap = adoptOSObject(xpc_copy_bootstrap());
 #if PLATFORM(IOS_FAMILY)
-    auto containerEnvironmentVariables = xpc_dictionary_get_value(event, "ContainerEnvironmentVariables");
+    auto containerEnvironmentVariables = xpc_dictionary_get_value(bootstrap.get(), "ContainerEnvironmentVariables");
     xpc_dictionary_apply(containerEnvironmentVariables, ^(const char *key, xpc_object_t value) {
         setenv(key, xpc_string_get_string_ptr(value), 1);
         return true;
@@ -123,29 +113,31 @@
     });
 #endif
 
+    if (bootstrap) {
 #if PLATFORM(MAC)
-    if (const char* webKitBundleVersion = xpc_dictionary_get_string(event, "WebKitBundleVersion")) {
-        CFBundleRef webKitBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.WebKit"));
-        NSString *expectedBundleVersion = (NSString *)CFBundleGetValueForInfoDictionaryKey(webKitBundle, kCFBundleVersionKey);
+        if (const char* webKitBundleVersion = xpc_dictionary_get_string(bootstrap.get(), "WebKitBundleVersion")) {
+            CFBundleRef webKitBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.WebKit"));
+            NSString *expectedBundleVersion = (NSString *)CFBundleGetValueForInfoDictionaryKey(webKitBundle, kCFBundleVersionKey);
 
-        if (strcmp(webKitBundleVersion, expectedBundleVersion.UTF8String)) {
-            _WKSetCrashReportApplicationSpecificInformation([NSString stringWithFormat:@"WebKit framework version mismatch: '%s'", webKitBundleVersion]);
-            __builtin_trap();
+            if (strcmp(webKitBundleVersion, expectedBundleVersion.UTF8String)) {
+                _WKSetCrashReportApplicationSpecificInformation([NSString stringWithFormat:@"WebKit framework version mismatch: '%s'", webKitBundleVersion]);
+                __builtin_trap();
+            }
         }
-    }
 #endif
 
-    if (xpc_object_t languages = xpc_dictionary_get_value(event, "OverrideLanguages")) {
-        @autoreleasepool {
-            NSDictionary *existingArguments = [[NSUserDefaults standardUserDefaults] volatileDomainForName:NSArgumentDomain];
-            NSMutableDictionary *newArguments = [existingArguments mutableCopy];
-            RetainPtr<NSMutableArray> newLanguages = adoptNS([[NSMutableArray alloc] init]);
-            xpc_array_apply(languages, ^(size_t index, xpc_object_t value) {
-                [newLanguages addObject:[NSString stringWithCString:xpc_string_get_string_ptr(value) encoding:NSUTF8StringEncoding]];
-                return true;
-            });
-            [newArguments setValue:newLanguages.get() forKey:@"AppleLanguages"];
-            [[NSUserDefaults standardUserDefaults] setVolatileDomain:newArguments forName:NSArgumentDomain];
+        if (xpc_object_t languages = xpc_dictionary_get_value(bootstrap.get(), "OverrideLanguages")) {
+            @autoreleasepool {
+                NSDictionary *existingArguments = [[NSUserDefaults standardUserDefaults] volatileDomainForName:NSArgumentDomain];
+                NSMutableDictionary *newArguments = [existingArguments mutableCopy];
+                RetainPtr<NSMutableArray> newLanguages = adoptNS([[NSMutableArray alloc] init]);
+                xpc_array_apply(languages, ^(size_t index, xpc_object_t value) {
+                    [newLanguages addObject:[NSString stringWithCString:xpc_string_get_string_ptr(value) encoding:NSUTF8StringEncoding]];
+                    return true;
+                });
+                [newArguments setValue:newLanguages.get() forKey:@"AppleLanguages"];
+                [[NSUserDefaults standardUserDefaults] setVolatileDomain:newArguments forName:NSArgumentDomain];
+            }
         }
     }
 
@@ -161,13 +153,8 @@
     }
 #endif
 #endif
-}
 
-int XPCServiceMain(int, const char**)
-{
-    xpc_main([] (xpc_connection_t peer) {
-        XPCEventHandler(peer, AuxiliaryProcessType::XPCService);
-    });
+    xpc_main(XPCServiceEventHandler);
     return 0;
 }
 

Modified: trunk/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h (241204 => 241205)


--- trunk/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h	2019-02-08 20:36:07 UTC (rev 241204)
+++ trunk/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h	2019-02-08 21:19:32 UTC (rev 241205)
@@ -182,9 +182,6 @@
 #if PLATFORM(COCOA)
     bool suppressesConnectionTerminationOnSystemChange() const { return m_suppressesConnectionTerminationOnSystemChange; }
     void setSuppressesConnectionTerminationOnSystemChange(bool suppressesConnectionTerminationOnSystemChange) { m_suppressesConnectionTerminationOnSystemChange = suppressesConnectionTerminationOnSystemChange; }
-
-    bool usesNetworkingDaemon() const { return m_usesNetworkingDaemon; }
-    void setUsesNetworkingDaemon(bool usesNetworkingDaemon) { m_usesNetworkingDaemon = usesNetworkingDaemon; }
 #endif
 
 private:
@@ -238,7 +235,6 @@
 
 #if PLATFORM(COCOA)
     bool m_suppressesConnectionTerminationOnSystemChange { false };
-    bool m_usesNetworkingDaemon { false };
 #endif
 };
 

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h (241204 => 241205)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h	2019-02-08 20:36:07 UTC (rev 241204)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h	2019-02-08 21:19:32 UTC (rev 241205)
@@ -70,7 +70,6 @@
 @property (nonatomic) BOOL pageCacheEnabled WK_API_AVAILABLE(macosx(10.14), ios(12.0));
 @property (nonatomic) BOOL suppressesConnectionTerminationOnSystemChange WK_API_AVAILABLE(macosx(10.14), ios(12.0));
 @property (nonatomic, getter=isJITEnabled) BOOL JITEnabled WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
-@property (nonatomic) BOOL usesNetworkingDaemon WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
 
 @end
 

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm (241204 => 241205)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm	2019-02-08 20:36:07 UTC (rev 241204)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm	2019-02-08 21:19:32 UTC (rev 241205)
@@ -316,17 +316,6 @@
     _processPoolConfiguration->setJITEnabled(enabled);
 }
 
-- (BOOL)usesNetworkingDaemon
-{
-    return _processPoolConfiguration->usesNetworkingDaemon();
-}
-
-- (void)setUsesNetworkingDaemon:(BOOL)enabled
-{
-    _processPoolConfiguration->setUsesNetworkingDaemon(enabled);
-}
-
-
 - (void)setSuppressesConnectionTerminationOnSystemChange:(BOOL)suppressesConnectionTerminationOnSystemChange
 {
     _processPoolConfiguration->setSuppressesConnectionTerminationOnSystemChange(suppressesConnectionTerminationOnSystemChange);

Modified: trunk/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp (241204 => 241205)


--- trunk/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp	2019-02-08 20:36:07 UTC (rev 241204)
+++ trunk/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp	2019-02-08 21:19:32 UTC (rev 241205)
@@ -72,8 +72,6 @@
     case ProcessLauncher::ProcessType::Network:
         varname = "NETWORK_PROCESS_CMD_PREFIX";
         break;
-    case ProcessLauncher::ProcessType::NetworkDaemon:
-        ASSERT_NOT_REACHED();
     }
     const char* processCmdPrefix = getenv(varname);
     if (processCmdPrefix && *processCmdPrefix)

Modified: trunk/Source/WebKit/UIProcess/Launcher/ProcessLauncher.h (241204 => 241205)


--- trunk/Source/WebKit/UIProcess/Launcher/ProcessLauncher.h	2019-02-08 20:36:07 UTC (rev 241204)
+++ trunk/Source/WebKit/UIProcess/Launcher/ProcessLauncher.h	2019-02-08 21:19:32 UTC (rev 241205)
@@ -65,7 +65,6 @@
         Plugin64,
 #endif
         Network,
-        NetworkDaemon
     };
 
     struct LaunchOptions {

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


--- trunk/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm	2019-02-08 20:36:07 UTC (rev 241204)
+++ trunk/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm	2019-02-08 21:19:32 UTC (rev 241205)
@@ -56,9 +56,6 @@
         return launchOptions.nonValidInjectedCodeAllowed ? "com.apple.WebKit.WebContent.Development" : "com.apple.WebKit.WebContent";
     case ProcessLauncher::ProcessType::Network:
         return "com.apple.WebKit.Networking";
-    case ProcessLauncher::ProcessType::NetworkDaemon:
-        ASSERT_NOT_REACHED();
-        return nullptr;
 #if ENABLE(NETSCAPE_PLUGIN_API)
     case ProcessLauncher::ProcessType::Plugin32:
         return "com.apple.WebKit.Plugin.32";
@@ -98,17 +95,18 @@
 {
     ASSERT(!m_xpcConnection);
 
-    if (m_launchOptions.processType == ProcessLauncher::ProcessType::NetworkDaemon)
-        m_xpcConnection = adoptOSObject(xpc_connection_create_mach_service("com.apple.WebKit.NetworkingDaemon", dispatch_get_main_queue(), 0));
-    else {
-        const char* name = m_launchOptions.customWebContentServiceBundleIdentifier.isNull() ? serviceName(m_launchOptions) : m_launchOptions.customWebContentServiceBundleIdentifier.data();
-        m_xpcConnection = adoptOSObject(xpc_connection_create(name, nullptr));
+    const char* name;
+    if (!m_launchOptions.customWebContentServiceBundleIdentifier.isNull())
+        name = m_launchOptions.customWebContentServiceBundleIdentifier.data();
+    else
+        name = serviceName(m_launchOptions);
 
-        uuid_t uuid;
-        uuid_generate(uuid);
-        xpc_connection_set_oneshot_instance(m_xpcConnection.get(), uuid);
-    }
+    m_xpcConnection = adoptOSObject(xpc_connection_create(name, nullptr));
 
+    uuid_t uuid;
+    uuid_generate(uuid);
+    xpc_connection_set_oneshot_instance(m_xpcConnection.get(), uuid);
+
     // Inherit UI process localization. It can be different from child process default localization:
     // 1. When the application and system frameworks simply have different localized resources available, we should match the application.
     // 1.1. An important case is WebKitTestRunner, where we should use English localizations for all system frameworks.
@@ -138,6 +136,7 @@
 #if PLATFORM(MAC)
     xpc_dictionary_set_string(initializationMessage.get(), "WebKitBundleVersion", [[NSBundle bundleWithIdentifier:@"com.apple.WebKit"].infoDictionary[(__bridge NSString *)kCFBundleVersionKey] UTF8String]);
 #endif
+    xpc_connection_set_bootstrap(m_xpcConnection.get(), initializationMessage.get());
 
     if (shouldLeakBoost(m_launchOptions)) {
         auto preBootstrapMessage = adoptOSObject(xpc_dictionary_create(nullptr, nullptr, 0));
@@ -172,9 +171,8 @@
     if (clientIdentifier.isNull())
         clientIdentifier = [[NSBundle mainBundle] bundleIdentifier];
 
+    // FIXME: Switch to xpc_connection_set_bootstrap once it's available everywhere we need.
     auto bootstrapMessage = adoptOSObject(xpc_dictionary_create(nullptr, nullptr, 0));
-
-    xpc_dictionary_set_value(bootstrapMessage.get(), "initialization-message", initializationMessage.get());
     
     if (m_client && !m_client->isJITEnabled())
         xpc_dictionary_set_bool(bootstrapMessage.get(), "disable-jit", true);
@@ -203,9 +201,6 @@
     auto errorHandlerImpl = [weakProcessLauncher = makeWeakPtr(*this), listeningPort] (xpc_object_t event) {
         ASSERT(!event || xpc_get_type(event) == XPC_TYPE_ERROR);
 
-        if (event)
-            LOG_ERROR("Error launching auxiliary process: %s", xpc_dictionary_get_string(event, XPC_ERROR_KEY_DESCRIPTION));
-
         auto processLauncher = weakProcessLauncher.get();
         if (!processLauncher)
             return;

Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp (241204 => 241205)


--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp	2019-02-08 20:36:07 UTC (rev 241204)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp	2019-02-08 21:19:32 UTC (rev 241205)
@@ -102,7 +102,7 @@
 
 void NetworkProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions)
 {
-    launchOptions.processType = m_processPool.usesNetworkingDaemon() ? ProcessLauncher::ProcessType::NetworkDaemon : ProcessLauncher::ProcessType::Network;
+    launchOptions.processType = ProcessLauncher::ProcessType::Network;
     AuxiliaryProcessProxy::getLaunchOptions(launchOptions);
 
     if (processPool().shouldMakeNextNetworkProcessLaunchFailForTesting()) {

Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (241204 => 241205)


--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2019-02-08 20:36:07 UTC (rev 241204)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2019-02-08 21:19:32 UTC (rev 241205)
@@ -1507,15 +1507,6 @@
         m_suspendedPages.removeFirst();
 }
 
-bool WebProcessPool::usesNetworkingDaemon() const
-{
-#if PLATFORM(COCOA)
-    return m_configuration->usesNetworkingDaemon();
-#else
-    return false;
-#endif
-}
-    
 void WebProcessPool::setCacheModel(CacheModel cacheModel)
 {
     m_configuration->setCacheModel(cacheModel);

Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.h (241204 => 241205)


--- trunk/Source/WebKit/UIProcess/WebProcessPool.h	2019-02-08 20:36:07 UTC (rev 241204)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.h	2019-02-08 21:19:32 UTC (rev 241205)
@@ -255,8 +255,6 @@
     DownloadProxy* createDownloadProxy(const WebCore::ResourceRequest&, WebPageProxy* originatingPage);
     API::DownloadClient& downloadClient() { return *m_downloadClient; }
 
-    bool usesNetworkingDaemon() const;
-    
     API::LegacyContextHistoryClient& historyClient() { return *m_historyClient; }
     WebContextClient& client() { return m_client; }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to