Add support for running the networking process as an XPCService
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 27 Jan 2013 05:32:53 +0000 (05:32 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 27 Jan 2013 05:32:53 +0000 (05:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=108025

Reviewed by Dan Bernstein.

* Configurations/NetworkService.Development.xcconfig: Copied from Source/WebKit2/Configurations/WebContentService.Development.xcconfig.
* Configurations/NetworkService.xcconfig: Copied from Source/WebKit2/Configurations/WebContentService.xcconfig.
Add configurations.

* NetworkProcess/EntryPoint/mac/XPCService: Added.
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService: Added.
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development: Added.
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/Info.plist: Copied from Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info.plist.
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/NetworkServiceMain.Development.mm: Copied from Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/WebContentServiceMain.Development.mm.
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info.plist: Copied from Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService/Info.plist.
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService/NetworkServiceMain.mm: Copied from Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService/WebContentServiceMain.mm.
* NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm: Copied from Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm.
(initializeNetworkService):
Add entry points.

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::serviceName):
(WebKit::connectToServiceForDevelopment):
(WebKit::createServiceForDevelopment):
(WebKit::createService):
(WebKit::createProcess):
(WebKit::ProcessLauncher::launchProcess):
Rework service creation to work for arbitrary services.

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::~NetworkProcessProxy):
(WebKit::NetworkProcessProxy::getLaunchOptions):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/mac/NetworkProcessProxyMac.mm:
(WebKit::shouldUseXPC):
(WebKit::NetworkProcessProxy::platformGetLaunchOptions):
Opt into xpc using the same rules as the WebProcess.

* WebKit2.xcodeproj/project.pbxproj:
Update files.

* WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
(initializeWebContentService):
Fix the comment to refer to the shim correctly.

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

14 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/Configurations/NetworkService.Development.xcconfig [new file with mode: 0644]
Source/WebKit2/Configurations/NetworkService.xcconfig [new file with mode: 0644]
Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/Info.plist [new file with mode: 0644]
Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/NetworkServiceMain.Development.mm [new file with mode: 0644]
Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info.plist [new file with mode: 0644]
Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkService/NetworkServiceMain.mm [new file with mode: 0644]
Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm [new file with mode: 0644]
Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm
Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp
Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h
Source/WebKit2/UIProcess/Network/mac/NetworkProcessProxyMac.mm
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm

index 936d39c..cf1da89 100644 (file)
@@ -1,5 +1,52 @@
 2013-01-26  Sam Weinig  <sam@webkit.org>
 
+        Add support for running the networking process as an XPCService
+        https://bugs.webkit.org/show_bug.cgi?id=108025
+
+        Reviewed by Dan Bernstein.
+
+        * Configurations/NetworkService.Development.xcconfig: Copied from Source/WebKit2/Configurations/WebContentService.Development.xcconfig.
+        * Configurations/NetworkService.xcconfig: Copied from Source/WebKit2/Configurations/WebContentService.xcconfig.
+        Add configurations.
+
+        * NetworkProcess/EntryPoint/mac/XPCService: Added.
+        * NetworkProcess/EntryPoint/mac/XPCService/NetworkService: Added.
+        * NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development: Added.
+        * NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/Info.plist: Copied from Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info.plist.
+        * NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/NetworkServiceMain.Development.mm: Copied from Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/WebContentServiceMain.Development.mm.
+        * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info.plist: Copied from Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService/Info.plist.
+        * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/NetworkServiceMain.mm: Copied from Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService/WebContentServiceMain.mm.
+        * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm: Copied from Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm.
+        (initializeNetworkService):
+        Add entry points.
+
+        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
+        (WebKit::serviceName):
+        (WebKit::connectToServiceForDevelopment):
+        (WebKit::createServiceForDevelopment):
+        (WebKit::createService):
+        (WebKit::createProcess):
+        (WebKit::ProcessLauncher::launchProcess):
+        Rework service creation to work for arbitrary services.
+
+        * UIProcess/Network/NetworkProcessProxy.cpp:
+        (WebKit::NetworkProcessProxy::~NetworkProcessProxy):
+        (WebKit::NetworkProcessProxy::getLaunchOptions):
+        * UIProcess/Network/NetworkProcessProxy.h:
+        * UIProcess/Network/mac/NetworkProcessProxyMac.mm:
+        (WebKit::shouldUseXPC):
+        (WebKit::NetworkProcessProxy::platformGetLaunchOptions):
+        Opt into xpc using the same rules as the WebProcess.
+
+        * WebKit2.xcodeproj/project.pbxproj:
+        Update files.
+
+        * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
+        (initializeWebContentService):
+        Fix the comment to refer to the shim correctly.
+
+2013-01-26  Sam Weinig  <sam@webkit.org>
+
         Simplify environment creation in XPC service re-exec
         https://bugs.webkit.org/show_bug.cgi?id=108017
 
diff --git a/Source/WebKit2/Configurations/NetworkService.Development.xcconfig b/Source/WebKit2/Configurations/NetworkService.Development.xcconfig
new file mode 100644 (file)
index 0000000..26f769f
--- /dev/null
@@ -0,0 +1,27 @@
+// Copyright (C) 2013 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. ``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
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+#include "BaseXPCService.xcconfig"
+
+PRODUCT_NAME = com.apple.WebKit.Networking.Development;
+INFOPLIST_FILE = NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/Info.plist;
diff --git a/Source/WebKit2/Configurations/NetworkService.xcconfig b/Source/WebKit2/Configurations/NetworkService.xcconfig
new file mode 100644 (file)
index 0000000..d0c2fd9
--- /dev/null
@@ -0,0 +1,27 @@
+// Copyright (C) 2012, 2013 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. ``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
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+#include "BaseXPCService.xcconfig"
+
+PRODUCT_NAME = com.apple.WebKit.Networking;
+INFOPLIST_FILE = NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info.plist;
diff --git a/Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/Info.plist b/Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/Info.plist
new file mode 100644 (file)
index 0000000..fad43ee
--- /dev/null
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>CFBundleGetInfoString</key>
+       <string>${BUNDLE_VERSION}, Copyright 2003-2013 Apple Inc.</string>
+       <key>CFBundleDevelopmentRegion</key>
+       <string>English</string>
+       <key>CFBundleExecutable</key>
+       <string>${EXECUTABLE_NAME}</string>
+       <key>CFBundleIdentifier</key>
+       <string>com.apple.WebKit.Networking.Development</string>
+       <key>CFBundleInfoDictionaryVersion</key>
+       <string>6.0</string>
+       <key>CFBundleName</key>
+       <string>${PRODUCT_NAME}</string>
+       <key>CFBundlePackageType</key>
+       <string>XPC!</string>
+       <key>CFBundleShortVersionString</key>
+       <string>${SHORT_VERSION_STRING}</string>
+       <key>CFBundleSignature</key>
+       <string>????</string>
+       <key>CFBundleVersion</key>
+       <string>${BUNDLE_VERSION}</string>
+       <key>LSFileQuarantineEnabled</key>
+       <true/>
+       <key>NSPrincipalClass</key>
+       <string>NSApplication</string>
+       <key>LSUIElement</key>
+       <true/>
+       <key>XPCService</key>
+       <dict>
+               <key>ServiceType</key>
+               <string>Application</string>
+               <key>RunLoopType</key>
+               <string>NSRunLoop</string>
+               <key>_MultipleInstances</key>
+               <true/>
+       </dict>
+</dict>
+</plist>
diff --git a/Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/NetworkServiceMain.Development.mm b/Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/NetworkServiceMain.Development.mm
new file mode 100644 (file)
index 0000000..a42e58d
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+#define WEBKIT_XPC_SERVICE_INITIALIZER initializeNetworkService
+#include "XPCServiceBootstrapper.Development.h"
+
+using namespace WebKit;
+
+int main(int argc, char** argv)
+{
+    xpc_main(XPCServiceEventHandler);
+    return 0;
+}
diff --git a/Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info.plist b/Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info.plist
new file mode 100644 (file)
index 0000000..bc983cf
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>CFBundleGetInfoString</key>
+       <string>${BUNDLE_VERSION}, Copyright 2003-2013 Apple Inc.</string>
+       <key>CFBundleDevelopmentRegion</key>
+       <string>English</string>
+       <key>CFBundleExecutable</key>
+       <string>${EXECUTABLE_NAME}</string>
+       <key>CFBundleIdentifier</key>
+       <string>com.apple.WebKit.Networking</string>
+       <key>CFBundleInfoDictionaryVersion</key>
+       <string>6.0</string>
+       <key>CFBundleName</key>
+       <string>${PRODUCT_NAME}</string>
+       <key>CFBundlePackageType</key>
+       <string>XPC!</string>
+       <key>CFBundleShortVersionString</key>
+       <string>${SHORT_VERSION_STRING}</string>
+       <key>CFBundleSignature</key>
+       <string>????</string>
+       <key>CFBundleVersion</key>
+       <string>${BUNDLE_VERSION}</string>
+       <key>LSFileQuarantineEnabled</key>
+       <true/>
+       <key>NSPrincipalClass</key>
+       <string>NSApplication</string>
+       <key>LSUIElement</key>
+       <true/>
+       <key>XPCService</key>
+       <dict>
+               <key>ServiceType</key>
+               <string>Application</string>
+               <key>RunLoopType</key>
+               <string>NSRunLoop</string>
+               <key>_MultipleInstances</key>
+               <true/>
+               <key>EnvironmentVariables</key>
+               <dict>
+                       <key>DYLD_INSERT_LIBRARIES</key>
+                       <string>$(WEBKIT2_FRAMEWORKS_DIR)/WebKit2.framework/WebProcess.app/Contents/MacOS/SecItemShim.dylib</string>
+               </dict>
+       </dict>
+</dict>
+</plist>
diff --git a/Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkService/NetworkServiceMain.mm b/Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkService/NetworkServiceMain.mm
new file mode 100644 (file)
index 0000000..736684e
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+#define WEBKIT_XPC_SERVICE_INITIALIZER initializeNetworkService
+#include "XPCServiceBootstrapper.h"
+
+using namespace WebKit;
+
+int main(int argc, char** argv)
+{
+    xpc_main(XPCServiceEventHandler);
+    return 0;
+}
diff --git a/Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm b/Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm
new file mode 100644 (file)
index 0000000..ee4dbce
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2013 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"
+
+#if HAVE(XPC)
+
+#import "EnvironmentUtilities.h"
+#import "WKBase.h"
+#import "WebKit2Initialize.h"
+#import "NetworkProcess.h"
+#import <WebCore/RunLoop.h>
+#import <stdio.h>
+#import <stdlib.h>
+#import <xpc/xpc.h>
+
+using namespace WebCore;
+using namespace WebKit;
+
+extern "C" WK_EXPORT void initializeNetworkService(const char* clientIdentifier, xpc_connection_t connection, mach_port_t serverPort, const char* uiProcessName);
+
+void initializeNetworkService(const char* clientIdentifier, xpc_connection_t connection, mach_port_t serverPort, const char* uiProcessName)
+{
+    // Remove the SecItemShim shim from the DYLD_INSERT_LIBRARIES environment variable so any processes spawned by
+    // the this process don't try to insert the shim and crash.
+    EnvironmentUtilities::stripValuesEndingWithString("DYLD_INSERT_LIBRARIES", "/SecItemShim.dylib");
+
+    InitializeWebKit2();
+
+    ChildProcessInitializationParameters parameters;
+    parameters.uiProcessName = uiProcessName;
+    parameters.clientIdentifier = clientIdentifier;
+    parameters.connectionIdentifier = CoreIPC::Connection::Identifier(serverPort, connection);
+
+    NetworkProcess::shared().initialize(parameters);
+}
+
+#endif // HAVE(XPC)
index 72d6820..63fd91f 100644 (file)
@@ -78,6 +78,29 @@ struct UUIDHolder : public RefCounted<UUIDHolder> {
 
 }
 
+static const char* serviceName(const ProcessLauncher::LaunchOptions& launchOptions, bool forDevelopment)
+{
+    switch (launchOptions.processType) {
+    case ProcessLauncher::WebProcess:
+        return forDevelopment ? "com.apple.WebKit.WebContent.Development" : "com.apple.WebKit.WebContent";
+#if ENABLE(NETWORK_PROCESS)
+    case ProcessLauncher::NetworkProcess:
+        return forDevelopment ? "com.apple.WebKit.Networking.Development" : "com.apple.WebKit.Networking";
+#endif
+#if ENABLE(PLUGIN_PROCESS)
+    case ProcessLauncher::PluginProcess:
+        ASSERT_NOT_REACHED();
+        return 0;
+#endif
+#if ENABLE(SHARED_WORKER_PROCESS)
+    case ProcessLauncher::SharedWorkerProcess:
+        ASSERT_NOT_REACHED();
+        return 0;
+#endif
+    }
+}
+
+
 static void setUpTerminationNotificationHandler(pid_t pid)
 {
 #if HAVE(DISPATCH_H)
@@ -142,10 +165,10 @@ static void addDYLDEnvironmentAdditions(const ProcessLauncher::LaunchOptions& la
 typedef void (ProcessLauncher::*DidFinishLaunchingProcessFunction)(PlatformProcessIdentifier, CoreIPC::Connection::Identifier);
 
 #if HAVE(XPC)
-static void connectToWebProcessServiceForWebKitDevelopment(const ProcessLauncher::LaunchOptions&, ProcessLauncher* that, DidFinishLaunchingProcessFunction didFinishLaunchingProcessFunction, UUIDHolder* instanceUUID)
+static void connectToServiceForDevelopment(const ProcessLauncher::LaunchOptions& launchOptions, ProcessLauncher* that, DidFinishLaunchingProcessFunction didFinishLaunchingProcessFunction, UUIDHolder* instanceUUID)
 {
     // Create a connection to the WebKit2 XPC service.
-    xpc_connection_t connection = xpc_connection_create("com.apple.WebKit.WebContent.Development", 0);
+    xpc_connection_t connection = xpc_connection_create(serviceName(launchOptions, true), 0);
     xpc_connection_set_instance(connection, instanceUUID->uuid);
 
     // XPC requires having an event handler, even if it is not used.
@@ -199,16 +222,16 @@ static void connectToWebProcessServiceForWebKitDevelopment(const ProcessLauncher
     xpc_release(bootstrapMessage);
 }
 
-static void createWebProcessServiceForWebKitDevelopment(const ProcessLauncher::LaunchOptions& launchOptions, ProcessLauncher* that, DidFinishLaunchingProcessFunction didFinishLaunchingProcessFunction)
+static void createServiceForDevelopment(const ProcessLauncher::LaunchOptions& launchOptions, ProcessLauncher* that, DidFinishLaunchingProcessFunction didFinishLaunchingProcessFunction)
 {
     EnvironmentVariables environmentVariables;
     addDYLDEnvironmentAdditions(launchOptions, true, environmentVariables);
 
     // Generate the uuid for the service instance we are about to create.
-    // FIXME: This UUID should be stored on the WebProcessProxy.
+    // FIXME: This UUID should be stored on the ChildProcessProxy.
     RefPtr<UUIDHolder> instanceUUID = UUIDHolder::create();
 
-    xpc_connection_t reExecConnection = xpc_connection_create("com.apple.WebKit.WebContent.Development", 0);
+    xpc_connection_t reExecConnection = xpc_connection_create(serviceName(launchOptions, true), 0);
     xpc_connection_set_instance(reExecConnection, instanceUUID->uuid);
 
     // Keep the ProcessLauncher alive while we do the re-execing (balanced in event handler).
@@ -220,7 +243,7 @@ static void createWebProcessServiceForWebKitDevelopment(const ProcessLauncher::L
     xpc_connection_set_event_handler(reExecConnection, ^(xpc_object_t event) {
         ASSERT(xpc_get_type(event) == XPC_TYPE_ERROR);
 
-        connectToWebProcessServiceForWebKitDevelopment(launchOptions, that, didFinishLaunchingProcessFunction, instanceUUID.get());
+        connectToServiceForDevelopment(launchOptions, that, didFinishLaunchingProcessFunction, instanceUUID.get());
 
         // Release the connection.
         xpc_release(reExecConnection);
@@ -254,14 +277,14 @@ static void createWebProcessServiceForWebKitDevelopment(const ProcessLauncher::L
     xpc_release(reExecMessage);
 }
 
-static void createWebProcessService(const ProcessLauncher::LaunchOptions& launchOptions, ProcessLauncher* that, DidFinishLaunchingProcessFunction didFinishLaunchingProcessFunction)
+static void createService(const ProcessLauncher::LaunchOptions& launchOptions, ProcessLauncher* that, DidFinishLaunchingProcessFunction didFinishLaunchingProcessFunction)
 {
     // Generate the uuid for the service instance we are about to create.
-    // FIXME: This UUID should be stored on the WebProcessProxy.
+    // FIXME: This UUID should be stored on the ChildProcessProxy.
     RefPtr<UUIDHolder> instanceUUID = UUIDHolder::create();
 
     // Create a connection to the WebKit2 XPC service.
-    xpc_connection_t connection = xpc_connection_create("com.apple.WebKit.WebContent", 0);
+    xpc_connection_t connection = xpc_connection_create(serviceName(launchOptions, false), 0);
     xpc_connection_set_instance(connection, instanceUUID->uuid);
 
     // XPC requires having an event handler, even if it is not used.
@@ -377,7 +400,7 @@ static void createProcess(const ProcessLauncher::LaunchOptions& launchOptions, b
     NSBundle *webKit2Bundle = [NSBundle bundleWithIdentifier:@"com.apple.WebKit2"];
 
     NSString *processPath = nil;
-    switch(launchOptions.processType) {
+    switch (launchOptions.processType) {
     case ProcessLauncher::WebProcess:
         processPath = [webKit2Bundle pathForAuxiliaryExecutable:@"WebProcess.app"];
         break;
@@ -477,13 +500,10 @@ void ProcessLauncher::launchProcess()
 
 #if HAVE(XPC)
     if (m_launchOptions.useXPC) {
-        if (m_launchOptions.processType == ProcessLauncher::WebProcess) {
-            if (isWebKitDevelopmentBuild)
-                createWebProcessServiceForWebKitDevelopment(m_launchOptions, this, &ProcessLauncher::didFinishLaunchingProcess);
-            else
-                createWebProcessService(m_launchOptions, this, &ProcessLauncher::didFinishLaunchingProcess);
-        } else
-            ASSERT_NOT_REACHED();
+        if (isWebKitDevelopmentBuild)
+            createServiceForDevelopment(m_launchOptions, this, &ProcessLauncher::didFinishLaunchingProcess);
+        else
+            createService(m_launchOptions, this, &ProcessLauncher::didFinishLaunchingProcess);
         return;
     }
 #endif
index d4f5047..ad648f2 100644 (file)
@@ -61,21 +61,14 @@ NetworkProcessProxy::NetworkProcessProxy(WebContext* webContext)
     connect();
 }
 
-void NetworkProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions)
+NetworkProcessProxy::~NetworkProcessProxy()
 {
-    launchOptions.processType = ProcessLauncher::NetworkProcess;
-
-#if PLATFORM(MAC)
-    launchOptions.architecture = ProcessLauncher::LaunchOptions::MatchCurrentArchitecture;
-    launchOptions.executableHeap = false;
-#if HAVE(XPC)
-    launchOptions.useXPC = false;
-#endif
-#endif
 }
 
-NetworkProcessProxy::~NetworkProcessProxy()
+void NetworkProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions)
 {
+    launchOptions.processType = ProcessLauncher::NetworkProcess;
+    platformGetLaunchOptions(launchOptions);
 }
 
 void NetworkProcessProxy::getNetworkProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply> reply)
index 4e07f0f..3c922b5 100644 (file)
@@ -67,6 +67,7 @@ private:
     NetworkProcessProxy(WebContext*);
 
     virtual void getLaunchOptions(ProcessLauncher::LaunchOptions&) OVERRIDE;
+    void platformGetLaunchOptions(ProcessLauncher::LaunchOptions&);
 
     void networkProcessCrashedOrFailedToLaunch();
 
index 901c707..7b910ed 100644 (file)
@@ -42,6 +42,30 @@ void NetworkProcessProxy::setApplicationIsOccluded(bool applicationIsOccluded)
     connection()->send(Messages::NetworkProcess::SetApplicationIsOccluded(applicationIsOccluded), 0);
 }
 
+#if HAVE(XPC)
+static bool shouldUseXPC()
+{
+    if (id value = [[NSUserDefaults standardUserDefaults] objectForKey:@"WebKit2UseXPCServiceForWebProcess"])
+        return [value boolValue];
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+    return true;
+#else
+    return false;
+#endif
+}
+#endif
+
+void NetworkProcessProxy::platformGetLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions)
+{
+    launchOptions.architecture = ProcessLauncher::LaunchOptions::MatchCurrentArchitecture;
+    launchOptions.executableHeap = false;
+
+#if HAVE(XPC)
+    launchOptions.useXPC = shouldUseXPC();
+#endif
+}
+
 } // namespace WebKit
 
 #endif // ENABLE(NETWORK_PROCESS)
index 5c4b4f9..06b8809 100644 (file)
                                BCDE0AC113272712001259FB /* PBXTargetDependency */,
                                E13A8A4D16287A5B00392929 /* PBXTargetDependency */,
                                510CC8481613C85300D03ED3 /* PBXTargetDependency */,
-                               BCAE9DFD160C0AB000A33217 /* PBXTargetDependency */,
                                BCA8D46815BCE0D6009DC1F1 /* PBXTargetDependency */,
+                               BCAE9DFD160C0AB000A33217 /* PBXTargetDependency */,
+                               BC8283D516B4C01F00A278FE /* PBXTargetDependency */,
+                               BC8283D716B4C02200A278FE /* PBXTargetDependency */,
                        );
                        name = All;
                        productName = WebKit2;
                BC82839416B4608000A278FE /* SharedWorkerProcessMainBootstrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC82839216B4607B00A278FE /* SharedWorkerProcessMainBootstrapper.cpp */; };
                BC82839516B4608300A278FE /* SharedWorkerProcessMain.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC82839316B4607B00A278FE /* SharedWorkerProcessMain.mm */; };
                BC82839916B48DC000A278FE /* WebContentServiceEntryPoint.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC82839816B48DC000A278FE /* WebContentServiceEntryPoint.mm */; };
+               BC8283AC16B4BF3F00A278FE /* NetworkServiceEntryPoint.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC8283A816B4BD9100A278FE /* NetworkServiceEntryPoint.mm */; };
+               BC8283B316B4BF7700A278FE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC8283B216B4BF7700A278FE /* Foundation.framework */; };
+               BC8283C616B4BFA800A278FE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC8283B216B4BF7700A278FE /* Foundation.framework */; };
+               BC8283D816B4DB2A00A278FE /* NetworkServiceMain.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC8283A416B4BD9100A278FE /* NetworkServiceMain.mm */; };
+               BC8283D916B4DB2E00A278FE /* NetworkServiceMain.Development.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC8283A716B4BD9100A278FE /* NetworkServiceMain.Development.mm */; };
+               BC8283DA16B4DB9300A278FE /* WebKit2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* WebKit2.framework */; };
                BC82DF2215BDF42200FC2841 /* com.apple.WebProcess.sb in Resources */ = {isa = PBXBuildFile; fileRef = E1967E37150AB5E200C73169 /* com.apple.WebProcess.sb */; };
                BC8452A71162C80900CAB9B5 /* DrawingArea.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8452A51162C80900CAB9B5 /* DrawingArea.cpp */; };
                BC8452A81162C80900CAB9B5 /* DrawingArea.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8452A61162C80900CAB9B5 /* DrawingArea.h */; };
                        remoteGlobalIDString = 510031EA1379CACB00C8DFE4;
                        remoteInfo = SecItemShim;
                };
+               BC8283D416B4C01F00A278FE /* PBXContainerItemProxy */ = {
+                       isa = PBXContainerItemProxy;
+                       containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
+                       proxyType = 1;
+                       remoteGlobalIDString = BC8283B016B4BF7700A278FE;
+                       remoteInfo = Networking;
+               };
+               BC8283D616B4C02200A278FE /* PBXContainerItemProxy */ = {
+                       isa = PBXContainerItemProxy;
+                       containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
+                       proxyType = 1;
+                       remoteGlobalIDString = BC8283C416B4BFA800A278FE;
+                       remoteInfo = Networking.Development;
+               };
                BCA8D46715BCE0D6009DC1F1 /* PBXContainerItemProxy */ = {
                        isa = PBXContainerItemProxy;
                        containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
                BC82839616B47EC400A278FE /* XPCServiceBootstrapper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPCServiceBootstrapper.h; sourceTree = "<group>"; };
                BC82839716B480F600A278FE /* XPCServiceBootstrapper.Development.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPCServiceBootstrapper.Development.h; sourceTree = "<group>"; };
                BC82839816B48DC000A278FE /* WebContentServiceEntryPoint.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebContentServiceEntryPoint.mm; sourceTree = "<group>"; };
+               BC8283A316B4BD9100A278FE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+               BC8283A416B4BD9100A278FE /* NetworkServiceMain.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = NetworkServiceMain.mm; sourceTree = "<group>"; };
+               BC8283A616B4BD9100A278FE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+               BC8283A716B4BD9100A278FE /* NetworkServiceMain.Development.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = NetworkServiceMain.Development.mm; sourceTree = "<group>"; };
+               BC8283A816B4BD9100A278FE /* NetworkServiceEntryPoint.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = NetworkServiceEntryPoint.mm; sourceTree = "<group>"; };
+               BC8283AA16B4BEAD00A278FE /* NetworkService.Development.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = NetworkService.Development.xcconfig; sourceTree = "<group>"; };
+               BC8283AB16B4BEAD00A278FE /* NetworkService.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = NetworkService.xcconfig; sourceTree = "<group>"; };
+               BC8283B116B4BF7700A278FE /* com.apple.WebKit.Networking.xpc */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = com.apple.WebKit.Networking.xpc; sourceTree = BUILT_PRODUCTS_DIR; };
+               BC8283B216B4BF7700A278FE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+               BC8283C516B4BFA800A278FE /* com.apple.WebKit.Networking.Development.xpc */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = com.apple.WebKit.Networking.Development.xpc; sourceTree = BUILT_PRODUCTS_DIR; };
                BC8452A51162C80900CAB9B5 /* DrawingArea.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DrawingArea.cpp; sourceTree = "<group>"; };
                BC8452A61162C80900CAB9B5 /* DrawingArea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingArea.h; sourceTree = "<group>"; };
                BC84EB1712A7100C0083F2DA /* WebPreferencesMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPreferencesMac.mm; sourceTree = "<group>"; };
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
+               BC8283AE16B4BF7700A278FE /* Frameworks */ = {
+                       isa = PBXFrameworksBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               BC8283B316B4BF7700A278FE /* Foundation.framework in Frameworks */,
+                               BC8283DA16B4DB9300A278FE /* WebKit2.framework in Frameworks */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               BC8283C216B4BFA800A278FE /* Frameworks */ = {
+                       isa = PBXFrameworksBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               BC8283C616B4BFA800A278FE /* Foundation.framework in Frameworks */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
                BCAE9DE6160C097400A33217 /* Frameworks */ = {
                        isa = PBXFrameworksBuildPhase;
                        buildActionMask = 2147483647;
                                8DC2EF5B0486A6940098B216 /* WebKit2.framework */,
                                1A50DB1E110A3BDC000D3FE5 /* WebProcess.app */,
                                510031F61379CACB00C8DFE4 /* SecItemShim.dylib */,
+                               BC8283B116B4BF7700A278FE /* com.apple.WebKit.Networking.xpc */,
+                               BC8283C516B4BFA800A278FE /* com.apple.WebKit.Networking.Development.xpc */,
                        );
                        name = Products;
                        sourceTree = "<group>";
                                1A4F976B100E7B6600637A18 /* DebugRelease.xcconfig */,
                                1A4F976C100E7B6600637A18 /* FeatureDefines.xcconfig */,
                                510CC8461613C7C600D03ED3 /* NetworkProcess.xcconfig */,
+                               BC8283AA16B4BEAD00A278FE /* NetworkService.Development.xcconfig */,
+                               BC8283AB16B4BEAD00A278FE /* NetworkService.xcconfig */,
                                BC122FA3132707F300F7EAC1 /* PluginProcess.xcconfig */,
                                E13A8A4B16287A1B00392929 /* SharedWorkerProcess.xcconfig */,
                                5183B3931379F85C00E8754E /* Shim.xcconfig */,
                                1A4F976E100E7B6600637A18 /* Version.xcconfig */,
-                               BCACC40E16B0B8A800B6E092 /* WebContentService.xcconfig */,
                                BCACC40F16B0B8A800B6E092 /* WebContentService.Development.xcconfig */,
+                               BCACC40E16B0B8A800B6E092 /* WebContentService.xcconfig */,
                                BCB86F4B116AAACD00CE20B7 /* WebKit2.xcconfig */,
                                5DAD7294116FF70B00EE5396 /* WebProcess.xcconfig */,
                        );
                        isa = PBXGroup;
                        children = (
                                BC82837E16B45DA500A278FE /* LegacyProcess */,
+                               BC8283A116B4BD9100A278FE /* XPCService */,
                        );
                        name = EntryPoint;
                        path = NetworkProcess/EntryPoint;
                        path = mac/LegacyProcess;
                        sourceTree = "<group>";
                };
+               BC8283A116B4BD9100A278FE /* XPCService */ = {
+                       isa = PBXGroup;
+                       children = (
+                               BC8283A216B4BD9100A278FE /* NetworkService */,
+                               BC8283A516B4BD9100A278FE /* NetworkService.Development */,
+                               BC8283A816B4BD9100A278FE /* NetworkServiceEntryPoint.mm */,
+                       );
+                       name = XPCService;
+                       path = mac/XPCService;
+                       sourceTree = "<group>";
+               };
+               BC8283A216B4BD9100A278FE /* NetworkService */ = {
+                       isa = PBXGroup;
+                       children = (
+                               BC8283A316B4BD9100A278FE /* Info.plist */,
+                               BC8283A416B4BD9100A278FE /* NetworkServiceMain.mm */,
+                       );
+                       path = NetworkService;
+                       sourceTree = "<group>";
+               };
+               BC8283A516B4BD9100A278FE /* NetworkService.Development */ = {
+                       isa = PBXGroup;
+                       children = (
+                               BC8283A616B4BD9100A278FE /* Info.plist */,
+                               BC8283A716B4BD9100A278FE /* NetworkServiceMain.Development.mm */,
+                       );
+                       path = NetworkService.Development;
+                       sourceTree = "<group>";
+               };
                BC8A501311765F4500757573 /* cpp */ = {
                        isa = PBXGroup;
                        children = (
                E13A8A2E162879AC00392929 /* Frameworks */ = {
                        isa = PBXGroup;
                        children = (
+                               BC8283B216B4BF7700A278FE /* Foundation.framework */,
                                E13A8A31162879AC00392929 /* Other Frameworks */,
                                E13A8A2F162879AC00392929 /* Cocoa.framework */,
                        );
                        productReference = BC3DE46615A91763008D26FC /* com.apple.WebKit.WebContent.xpc */;
                        productType = "com.apple.product-type.bundle";
                };
+               BC8283B016B4BF7700A278FE /* Networking */ = {
+                       isa = PBXNativeTarget;
+                       buildConfigurationList = BC8283BD16B4BF7700A278FE /* Build configuration list for PBXNativeTarget "Networking" */;
+                       buildPhases = (
+                               BC8283AD16B4BF7700A278FE /* Sources */,
+                               BC8283AE16B4BF7700A278FE /* Frameworks */,
+                               BC8283AF16B4BF7700A278FE /* Resources */,
+                       );
+                       buildRules = (
+                       );
+                       dependencies = (
+                       );
+                       name = Networking;
+                       productName = Networking;
+                       productReference = BC8283B116B4BF7700A278FE /* com.apple.WebKit.Networking.xpc */;
+                       productType = "com.apple.product-type.bundle";
+               };
+               BC8283C416B4BFA800A278FE /* Networking.Development */ = {
+                       isa = PBXNativeTarget;
+                       buildConfigurationList = BC8283D016B4BFA800A278FE /* Build configuration list for PBXNativeTarget "Networking.Development" */;
+                       buildPhases = (
+                               BC8283C116B4BFA800A278FE /* Sources */,
+                               BC8283C216B4BFA800A278FE /* Frameworks */,
+                               BC8283C316B4BFA800A278FE /* Resources */,
+                       );
+                       buildRules = (
+                       );
+                       dependencies = (
+                       );
+                       name = Networking.Development;
+                       productName = Networking.Development;
+                       productReference = BC8283C516B4BFA800A278FE /* com.apple.WebKit.Networking.Development.xpc */;
+                       productType = "com.apple.product-type.bundle";
+               };
                BCAE9DE8160C097400A33217 /* WebContent.Development */ = {
                        isa = PBXNativeTarget;
                        buildConfigurationList = BCAE9DF6160C097500A33217 /* Build configuration list for PBXNativeTarget "WebContent.Development" */;
                                510031EA1379CACB00C8DFE4 /* SecItemShim */,
                                BC3DE46515A91763008D26FC /* WebContent */,
                                BCAE9DE8160C097400A33217 /* WebContent.Development */,
+                               BC8283B016B4BF7700A278FE /* Networking */,
+                               BC8283C416B4BFA800A278FE /* Networking.Development */,
                        );
                };
 /* End PBXProject section */
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
+               BC8283AF16B4BF7700A278FE /* Resources */ = {
+                       isa = PBXResourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               BC8283C316B4BFA800A278FE /* Resources */ = {
+                       isa = PBXResourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
                BCAE9DE7160C097400A33217 /* Resources */ = {
                        isa = PBXResourcesBuildPhase;
                        buildActionMask = 2147483647;
                        inputPaths = (
                                "$(BUILT_PRODUCTS_DIR)/com.apple.WebKit.WebContent.xpc",
                                "$(BUILT_PRODUCTS_DIR)/com.apple.WebKit.WebContent.Development.xpc",
+                               "$(BUILT_PRODUCTS_DIR)/com.apple.WebKit.Networking.xpc",
+                               "$(BUILT_PRODUCTS_DIR)/com.apple.WebKit.Networking.Development.xpc",
                        );
                        name = "Copy XPC services for engineering builds";
                        outputPaths = (
                                "$(BUILT_PRODUCTS_DIR)/${WRAPPER_NAME}/WebKit2.framework/Versions/A/XPCServices/com.apple.WebKit.WebContent.xpc",
                                "$(BUILT_PRODUCTS_DIR)/${WRAPPER_NAME}/WebKit2.framework/Versions/A/XPCServices/com.apple.WebKit.WebContent.Development.xpc",
+                               "$(BUILT_PRODUCTS_DIR)/${WRAPPER_NAME}/WebKit2.framework/Versions/A/XPCServices/com.apple.WebKit.Networking.xpc",
+                               "$(BUILT_PRODUCTS_DIR)/${WRAPPER_NAME}/WebKit2.framework/Versions/A/XPCServices/com.apple.WebKit.Networking.Development.xpc",
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                        shellPath = /bin/sh;
-                       shellScript = "if [[ \"${CONFIGURATION}\" == \"Production\" ]]; then\n    exit\nfi\n\nXPC_SERVICES_PATH=\"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/WebKit2.framework/Versions/A/XPCServices\"\nmkdir -p \"${XPC_SERVICES_PATH}\"\nditto \"${BUILT_PRODUCTS_DIR}/com.apple.WebKit.WebContent.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.WebContent.xpc\"\nditto \"${BUILT_PRODUCTS_DIR}/com.apple.WebKit.WebContent.Development.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.WebContent.Development.xpc\"\n";
+                       shellScript = "if [[ \"${CONFIGURATION}\" == \"Production\" ]]; then\n    exit\nfi\n\nXPC_SERVICES_PATH=\"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/WebKit2.framework/Versions/A/XPCServices\"\nmkdir -p \"${XPC_SERVICES_PATH}\"\nditto \"${BUILT_PRODUCTS_DIR}/com.apple.WebKit.WebContent.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.WebContent.xpc\"\nditto \"${BUILT_PRODUCTS_DIR}/com.apple.WebKit.WebContent.Development.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.WebContent.Development.xpc\"\nditto \"${BUILT_PRODUCTS_DIR}/com.apple.WebKit.Networking.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.Networking.xpc\"\nditto \"${BUILT_PRODUCTS_DIR}/com.apple.WebKit.Networking.Development.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.Networking.Development.xpc\"\n";
                };
                C0CE72841247E66800BC0EC4 /* Generate Derived Sources */ = {
                        isa = PBXShellScriptBuildPhase;
                                BC82838C16B45F0700A278FE /* PluginProcessMain.mm in Sources */,
                                BC82839516B4608300A278FE /* SharedWorkerProcessMain.mm in Sources */,
                                BC82839916B48DC000A278FE /* WebContentServiceEntryPoint.mm in Sources */,
+                               BC8283AC16B4BF3F00A278FE /* NetworkServiceEntryPoint.mm in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
+               BC8283AD16B4BF7700A278FE /* Sources */ = {
+                       isa = PBXSourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               BC8283D816B4DB2A00A278FE /* NetworkServiceMain.mm in Sources */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               BC8283C116B4BFA800A278FE /* Sources */ = {
+                       isa = PBXSourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               BC8283D916B4DB2E00A278FE /* NetworkServiceMain.Development.mm in Sources */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
                BCAE9DE5160C097400A33217 /* Sources */ = {
                        isa = PBXSourcesBuildPhase;
                        buildActionMask = 2147483647;
                        target = 510031EA1379CACB00C8DFE4 /* SecItemShim */;
                        targetProxy = 5183B38D1379F54600E8754E /* PBXContainerItemProxy */;
                };
+               BC8283D516B4C01F00A278FE /* PBXTargetDependency */ = {
+                       isa = PBXTargetDependency;
+                       target = BC8283B016B4BF7700A278FE /* Networking */;
+                       targetProxy = BC8283D416B4C01F00A278FE /* PBXContainerItemProxy */;
+               };
+               BC8283D716B4C02200A278FE /* PBXTargetDependency */ = {
+                       isa = PBXTargetDependency;
+                       target = BC8283C416B4BFA800A278FE /* Networking.Development */;
+                       targetProxy = BC8283D616B4C02200A278FE /* PBXContainerItemProxy */;
+               };
                BCA8D46815BCE0D6009DC1F1 /* PBXTargetDependency */ = {
                        isa = PBXTargetDependency;
                        target = BC3DE46515A91763008D26FC /* WebContent */;
                        };
                        name = Production;
                };
+               BC8283BE16B4BF7700A278FE /* Debug */ = {
+                       isa = XCBuildConfiguration;
+                       baseConfigurationReference = BC8283AB16B4BEAD00A278FE /* NetworkService.xcconfig */;
+                       buildSettings = {
+                       };
+                       name = Debug;
+               };
+               BC8283BF16B4BF7700A278FE /* Release */ = {
+                       isa = XCBuildConfiguration;
+                       baseConfigurationReference = BC8283AB16B4BEAD00A278FE /* NetworkService.xcconfig */;
+                       buildSettings = {
+                       };
+                       name = Release;
+               };
+               BC8283C016B4BF7700A278FE /* Production */ = {
+                       isa = XCBuildConfiguration;
+                       baseConfigurationReference = BC8283AB16B4BEAD00A278FE /* NetworkService.xcconfig */;
+                       buildSettings = {
+                       };
+                       name = Production;
+               };
+               BC8283D116B4BFA800A278FE /* Debug */ = {
+                       isa = XCBuildConfiguration;
+                       baseConfigurationReference = BC8283AA16B4BEAD00A278FE /* NetworkService.Development.xcconfig */;
+                       buildSettings = {
+                       };
+                       name = Debug;
+               };
+               BC8283D216B4BFA800A278FE /* Release */ = {
+                       isa = XCBuildConfiguration;
+                       baseConfigurationReference = BC8283AA16B4BEAD00A278FE /* NetworkService.Development.xcconfig */;
+                       buildSettings = {
+                       };
+                       name = Release;
+               };
+               BC8283D316B4BFA800A278FE /* Production */ = {
+                       isa = XCBuildConfiguration;
+                       baseConfigurationReference = BC8283AA16B4BEAD00A278FE /* NetworkService.Development.xcconfig */;
+                       buildSettings = {
+                       };
+                       name = Production;
+               };
                BCAE9DF7160C097500A33217 /* Debug */ = {
                        isa = XCBuildConfiguration;
                        baseConfigurationReference = BCACC40F16B0B8A800B6E092 /* WebContentService.Development.xcconfig */;
                        defaultConfigurationIsVisible = 0;
                        defaultConfigurationName = Production;
                };
+               BC8283BD16B4BF7700A278FE /* Build configuration list for PBXNativeTarget "Networking" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               BC8283BE16B4BF7700A278FE /* Debug */,
+                               BC8283BF16B4BF7700A278FE /* Release */,
+                               BC8283C016B4BF7700A278FE /* Production */,
+                       );
+                       defaultConfigurationIsVisible = 0;
+               };
+               BC8283D016B4BFA800A278FE /* Build configuration list for PBXNativeTarget "Networking.Development" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               BC8283D116B4BFA800A278FE /* Debug */,
+                               BC8283D216B4BFA800A278FE /* Release */,
+                               BC8283D316B4BFA800A278FE /* Production */,
+                       );
+                       defaultConfigurationIsVisible = 0;
+               };
                BCAE9DF6160C097500A33217 /* Build configuration list for PBXNativeTarget "WebContent.Development" */ = {
                        isa = XCConfigurationList;
                        buildConfigurations = (
index 8ae788b..d9a0af8 100644 (file)
@@ -43,8 +43,8 @@ extern "C" WK_EXPORT void initializeWebContentService(const char* clientIdentifi
 
 void initializeWebContentService(const char* clientIdentifier, xpc_connection_t connection, mach_port_t serverPort, const char* uiProcessName)
 {
-    // Remove the WebProcess shim from the DYLD_INSERT_LIBRARIES environment variable so any processes spawned by
-    // the WebProcess don't try to insert the shim and crash.
+    // Remove the SecItemShim shim from the DYLD_INSERT_LIBRARIES environment variable so any processes spawned by
+    // the this process don't try to insert the shim and crash.
     EnvironmentUtilities::stripValuesEndingWithString("DYLD_INSERT_LIBRARIES", "/SecItemShim.dylib");
 
     RunLoop::setUseApplicationRunLoopOnMainRunLoop();