Diff
Modified: trunk/Source/WebKit2/ChangeLog (140869 => 140870)
--- trunk/Source/WebKit2/ChangeLog 2013-01-25 23:02:26 UTC (rev 140869)
+++ trunk/Source/WebKit2/ChangeLog 2013-01-25 23:22:15 UTC (rev 140870)
@@ -1,3 +1,29 @@
+2013-01-25 Sam Weinig <s...@webkit.org>
+
+ Move the WebContentServices to WebProcess/EntryPoint/mac/XPCService/.
+
+ Reviewed by Anders Carlsson.
+
+ * Configurations/WebContentService.Development.xcconfig:
+ * Configurations/WebContentService.xcconfig:
+ * WebKit2.xcodeproj/project.pbxproj:
+ * WebProcess/EntryPoint: Added.
+ * WebProcess/EntryPoint/mac: Added.
+ * WebProcess/EntryPoint/mac/LegacyProcess: Added.
+ * WebProcess/EntryPoint/mac/XPCService: Added.
+ * WebProcess/EntryPoint/mac/XPCService/WebContentService: Copied from WebProcessService.
+ * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development: Copied from WebProcessServiceForWebKitDevelopment.
+ * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/WebContentServiceMain.Development.mm: Copied from WebProcessServiceForWebKitDevelopment/WebProcessServiceForWebKitDevelopmentMain.mm.
+ * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/WebProcessServiceForWebKitDevelopmentMain.mm: Removed.
+ * WebProcess/EntryPoint/mac/XPCService/WebContentService/WebContentServiceMain.mm: Copied from WebProcessService/WebProcessServiceMain.mm.
+ * WebProcess/EntryPoint/mac/XPCService/WebContentService/WebProcessServiceMain.mm: Removed.
+ * WebProcessService: Removed.
+ * WebProcessService/Info.plist: Removed.
+ * WebProcessService/WebProcessServiceMain.mm: Removed.
+ * WebProcessServiceForWebKitDevelopment: Removed.
+ * WebProcessServiceForWebKitDevelopment/Info.plist: Removed.
+ * WebProcessServiceForWebKitDevelopment/WebProcessServiceForWebKitDevelopmentMain.mm: Removed.
+
2013-01-25 Ivan Krstić <i...@apple.com>
Prepend common plugin sandbox profile to specific per-plugin one.
Modified: trunk/Source/WebKit2/Configurations/WebContentService.Development.xcconfig (140869 => 140870)
--- trunk/Source/WebKit2/Configurations/WebContentService.Development.xcconfig 2013-01-25 23:02:26 UTC (rev 140869)
+++ trunk/Source/WebKit2/Configurations/WebContentService.Development.xcconfig 2013-01-25 23:22:15 UTC (rev 140870)
@@ -24,4 +24,4 @@
#include "BaseXPCService.xcconfig"
PRODUCT_NAME = com.apple.WebKit.WebContent.Development;
-INFOPLIST_FILE = WebProcessServiceForWebKitDevelopment/Info.plist;
+INFOPLIST_FILE = WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info.plist;
Modified: trunk/Source/WebKit2/Configurations/WebContentService.xcconfig (140869 => 140870)
--- trunk/Source/WebKit2/Configurations/WebContentService.xcconfig 2013-01-25 23:02:26 UTC (rev 140869)
+++ trunk/Source/WebKit2/Configurations/WebContentService.xcconfig 2013-01-25 23:22:15 UTC (rev 140870)
@@ -24,4 +24,4 @@
#include "BaseXPCService.xcconfig"
PRODUCT_NAME = com.apple.WebKit.WebContent;
-INFOPLIST_FILE = WebProcessService/Info.plist;
+INFOPLIST_FILE = WebProcess/EntryPoint/mac/XPCService/WebContentService/Info.plist;
Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (140869 => 140870)
--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2013-01-25 23:02:26 UTC (rev 140869)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2013-01-25 23:22:15 UTC (rev 140870)
@@ -858,9 +858,11 @@
BCA8C6B011E3C08700812FB7 /* InjectedBundlePageUIClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA8C6AE11E3C08700812FB7 /* InjectedBundlePageUIClient.h */; };
BCAC111F12C92C1F00B08EEE /* WebDatabaseManagerProxyClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAC111D12C92C1F00B08EEE /* WebDatabaseManagerProxyClient.h */; };
BCAC112012C92C1F00B08EEE /* WebDatabaseManagerProxyClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCAC111E12C92C1F00B08EEE /* WebDatabaseManagerProxyClient.cpp */; };
+ BCACC44516B24CAA00B6E092 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = BCACC44016B24CAA00B6E092 /* Info.plist */; };
+ BCACC44716B24CAA00B6E092 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = BCACC44316B24CAA00B6E092 /* Info.plist */; };
+ BCACC44916B24D3200B6E092 /* WebContentServiceMain.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCACC44116B24CAA00B6E092 /* WebContentServiceMain.mm */; };
+ BCACC44A16B24D3600B6E092 /* WebContentServiceMain.Development.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCACC44416B24CAA00B6E092 /* WebContentServiceMain.Development.mm */; };
BCAE9DFB160C0AA100A33217 /* com.apple.WebProcess.sb in Resources */ = {isa = PBXBuildFile; fileRef = E1967E37150AB5E200C73169 /* com.apple.WebProcess.sb */; };
- BCAE9E05160C137800A33217 /* WebProcessServiceForWebKitDevelopmentMain.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCAE9E04160C137800A33217 /* WebProcessServiceForWebKitDevelopmentMain.mm */; };
- BCAE9E07160C139A00A33217 /* WebProcessServiceMain.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCAE9E06160C139A00A33217 /* WebProcessServiceMain.mm */; };
BCAE9E08160C1C0700A33217 /* WebKit2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* WebKit2.framework */; };
BCAE9E09160C233B00A33217 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC3DE46815A91763008D26FC /* Foundation.framework */; };
BCB0AD33122F285800B1341E /* MutableArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC8049D122F0D6B00103529 /* MutableArray.cpp */; };
@@ -2157,11 +2159,11 @@
BCACC40D16B0B7BE00B6E092 /* BaseXPCService.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = BaseXPCService.xcconfig; sourceTree = "<group>"; };
BCACC40E16B0B8A800B6E092 /* WebContentService.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = WebContentService.xcconfig; sourceTree = "<group>"; };
BCACC40F16B0B8A800B6E092 /* WebContentService.Development.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = WebContentService.Development.xcconfig; sourceTree = "<group>"; };
- BCAE9DE9160C097400A33217 /* com.apple.WebKit.WebContentForDevelopment.xpc */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; name = com.apple.WebKit.WebContentForDevelopment.xpc; path = com.apple.WebKit.WebContent.Development.xpc; sourceTree = BUILT_PRODUCTS_DIR; };
- BCAE9DEF160C097500A33217 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
- BCAE9E01160C12DA00A33217 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = WebProcessService/Info.plist; sourceTree = "<group>"; };
- BCAE9E04160C137800A33217 /* WebProcessServiceForWebKitDevelopmentMain.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebProcessServiceForWebKitDevelopmentMain.mm; sourceTree = "<group>"; };
- BCAE9E06160C139A00A33217 /* WebProcessServiceMain.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebProcessServiceMain.mm; path = WebProcessService/WebProcessServiceMain.mm; sourceTree = "<group>"; };
+ BCACC44016B24CAA00B6E092 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ BCACC44116B24CAA00B6E092 /* WebContentServiceMain.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebContentServiceMain.mm; sourceTree = "<group>"; };
+ BCACC44316B24CAA00B6E092 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ BCACC44416B24CAA00B6E092 /* WebContentServiceMain.Development.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebContentServiceMain.Development.mm; sourceTree = "<group>"; };
+ BCAE9DE9160C097400A33217 /* com.apple.WebKit.WebContent.Development.xpc */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = com.apple.WebKit.WebContent.Development.xpc; sourceTree = BUILT_PRODUCTS_DIR; };
BCB0AEE7122F53E300B1341E /* MutableDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MutableDictionary.h; sourceTree = "<group>"; };
BCB0AEE8122F53E300B1341E /* MutableDictionary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MutableDictionary.cpp; sourceTree = "<group>"; };
BCB0B0DB12305A2500B1341E /* WebContextUserMessageCoders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextUserMessageCoders.h; sourceTree = "<group>"; };
@@ -2498,7 +2500,7 @@
isa = PBXGroup;
children = (
BC3DE46615A91763008D26FC /* com.apple.WebKit.WebContent.xpc */,
- BCAE9DE9160C097400A33217 /* com.apple.WebKit.WebContentForDevelopment.xpc */,
+ BCAE9DE9160C097400A33217 /* com.apple.WebKit.WebContent.Development.xpc */,
510CC80E1613C79900D03ED3 /* NetworkProcess.app */,
BCDE094213272496001259FB /* PluginProcess.app */,
1AC25FB012A48EA700BD2671 /* PluginProcessShim.dylib */,
@@ -2556,8 +2558,6 @@
E1EDFD9716287AEC0039ECDA /* SharedWorkerProcess */,
BC8A500E11765AD400757573 /* WebKit2 */,
BC8A500F11765AE300757573 /* WebProcess */,
- BC3DE47815A917C6008D26FC /* WebProcessService */,
- BCAE9DED160C097400A33217 /* WebProcessServiceForWebKitDevelopment */,
6D8A91A511F0EFD100DD01FE /* com.apple.WebProcess.sb.in */,
1CBC945D16515ED200D68AAE /* Dock.pdf */,
089C1666FE841158C02AAC07 /* InfoPlist.strings */,
@@ -3416,6 +3416,7 @@
BC032D5C10F436D50058C15A /* WebProcess */ = {
isa = PBXGroup;
children = (
+ BCACC43B16B24C5D00B6E092 /* EntryPoint */,
512E352A130B559900ABD19A /* ApplicationCache */,
3309344B1315B93A0097A7BC /* Cookies */,
CD73BA3D131A2A2100EEDED2 /* FullScreen */,
@@ -4037,15 +4038,6 @@
tabWidth = 8;
usesTabs = 0;
};
- BC3DE47815A917C6008D26FC /* WebProcessService */ = {
- isa = PBXGroup;
- children = (
- BCAE9E01160C12DA00A33217 /* Info.plist */,
- BCAE9E06160C139A00A33217 /* WebProcessServiceMain.mm */,
- );
- name = WebProcessService;
- sourceTree = "<group>";
- };
BC4075D5124FEFFA0068F20A /* cf */ = {
isa = PBXGroup;
children = (
@@ -4143,15 +4135,51 @@
path = mac;
sourceTree = "<group>";
};
- BCAE9DED160C097400A33217 /* WebProcessServiceForWebKitDevelopment */ = {
+ BCACC43B16B24C5D00B6E092 /* EntryPoint */ = {
isa = PBXGroup;
children = (
- BCAE9DEF160C097500A33217 /* Info.plist */,
- BCAE9E04160C137800A33217 /* WebProcessServiceForWebKitDevelopmentMain.mm */,
+ BCACC43D16B24C7D00B6E092 /* LegacyProcess */,
+ BCACC43E16B24C8B00B6E092 /* XPCService */,
);
- path = WebProcessServiceForWebKitDevelopment;
+ path = EntryPoint;
sourceTree = "<group>";
};
+ BCACC43D16B24C7D00B6E092 /* LegacyProcess */ = {
+ isa = PBXGroup;
+ children = (
+ );
+ name = LegacyProcess;
+ path = mac/LegacyProcess;
+ sourceTree = "<group>";
+ };
+ BCACC43E16B24C8B00B6E092 /* XPCService */ = {
+ isa = PBXGroup;
+ children = (
+ BCACC43F16B24CAA00B6E092 /* WebContentService */,
+ BCACC44216B24CAA00B6E092 /* WebContentService.Development */,
+ );
+ name = XPCService;
+ path = mac/XPCService;
+ sourceTree = "<group>";
+ };
+ BCACC43F16B24CAA00B6E092 /* WebContentService */ = {
+ isa = PBXGroup;
+ children = (
+ BCACC44016B24CAA00B6E092 /* Info.plist */,
+ BCACC44116B24CAA00B6E092 /* WebContentServiceMain.mm */,
+ );
+ path = WebContentService;
+ sourceTree = "<group>";
+ };
+ BCACC44216B24CAA00B6E092 /* WebContentService.Development */ = {
+ isa = PBXGroup;
+ children = (
+ BCACC44316B24CAA00B6E092 /* Info.plist */,
+ BCACC44416B24CAA00B6E092 /* WebContentServiceMain.Development.mm */,
+ );
+ path = WebContentService.Development;
+ sourceTree = "<group>";
+ };
BCBAAC58144E38B90053F82F /* WKView Details */ = {
isa = PBXGroup;
children = (
@@ -5216,7 +5244,7 @@
);
name = WebContent.Development;
productName = WebProcessServiceForWebKitDevelopment;
- productReference = BCAE9DE9160C097400A33217 /* com.apple.WebKit.WebContentForDevelopment.xpc */;
+ productReference = BCAE9DE9160C097400A33217 /* com.apple.WebKit.WebContent.Development.xpc */;
productType = "com.apple.product-type.bundle";
};
BCDE093313272496001259FB /* PluginProcess */ = {
@@ -5321,6 +5349,8 @@
BC9FA523160D4A0F0054DF9A /* com.apple.WebProcess.sb in Resources */,
1CBC945E16515ED200D68AAE /* Dock.pdf in Resources */,
8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */,
+ BCACC44516B24CAA00B6E092 /* Info.plist in Resources */,
+ BCACC44716B24CAA00B6E092 /* Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -6070,7 +6100,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- BCAE9E07160C139A00A33217 /* WebProcessServiceMain.mm in Sources */,
+ BCACC44916B24D3200B6E092 /* WebContentServiceMain.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -6078,7 +6108,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- BCAE9E05160C137800A33217 /* WebProcessServiceForWebKitDevelopmentMain.mm in Sources */,
+ BCACC44A16B24D3600B6E092 /* WebContentServiceMain.Development.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Copied: trunk/Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService/WebContentServiceMain.mm (from rev 140775, trunk/Source/WebKit2/WebProcessService/WebProcessServiceMain.mm) (0 => 140870)
--- trunk/Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService/WebContentServiceMain.mm (rev 0)
+++ trunk/Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService/WebContentServiceMain.mm 2013-01-25 23:22:15 UTC (rev 140870)
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+
+#import "WebProcessServiceEntryPoints.h"
+
+int main(int argc, char** argv)
+{
+ return webProcessServiceMain(argc, argv);
+}
Deleted: trunk/Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService/WebProcessServiceMain.mm (140775 => 140870)
--- trunk/Source/WebKit2/WebProcessService/WebProcessServiceMain.mm 2013-01-25 05:06:31 UTC (rev 140775)
+++ trunk/Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService/WebProcessServiceMain.mm 2013-01-25 23:22:15 UTC (rev 140870)
@@ -1,31 +0,0 @@
-/*
- * 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.
- */
-
-#import "WebProcessServiceEntryPoints.h"
-
-int main(int argc, char** argv)
-{
- return webProcessServiceMain(argc, argv);
-}
Copied: trunk/Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/WebContentServiceMain.Development.mm (from rev 140775, trunk/Source/WebKit2/WebProcessServiceForWebKitDevelopment/WebProcessServiceForWebKitDevelopmentMain.mm) (0 => 140870)
--- trunk/Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/WebContentServiceMain.Development.mm (rev 0)
+++ trunk/Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/WebContentServiceMain.Development.mm 2013-01-25 23:22:15 UTC (rev 140870)
@@ -0,0 +1,149 @@
+/*
+ * 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.
+ */
+
+#import <AvailabilityMacros.h>
+
+#import <crt_externs.h>
+#import <dlfcn.h>
+#import <mach-o/dyld.h>
+#import <spawn.h>
+#import <stdio.h>
+#import <stdlib.h>
+#import <xpc/xpc.h>
+
+extern "C" mach_port_t xpc_dictionary_copy_mach_send(xpc_object_t, const char*);
+
+static void WebProcessServiceForWebKitDevelopmentEventHandler(xpc_connection_t peer)
+{
+ xpc_connection_set_target_queue(peer, dispatch_get_main_queue());
+ xpc_connection_set_event_handler(peer, ^(xpc_object_t event) {
+ xpc_type_t type = xpc_get_type(event);
+ if (type == XPC_TYPE_ERROR) {
+ if (event == XPC_ERROR_CONNECTION_INVALID || event == XPC_ERROR_TERMINATION_IMMINENT) {
+ // FIXME: Handle this case more gracefully.
+ exit(EXIT_FAILURE);
+ }
+ } else {
+ assert(type == XPC_TYPE_DICTIONARY);
+
+ if (!strcmp(xpc_dictionary_get_string(event, "message-name"), "re-exec")) {
+ // Setup the posix_spawn attributes.
+ posix_spawnattr_t attr;
+ posix_spawnattr_init(&attr);
+
+ short flags = 0;
+
+ // We just want to set the process state, not actually launch a new process,
+ // so we are going to use the darwin extension to posix_spawn POSIX_SPAWN_SETEXEC
+ // to act like a more full featured exec.
+ flags |= POSIX_SPAWN_SETEXEC;
+
+ // We want our process to receive all signals.
+ sigset_t signalMaskSet;
+ sigemptyset(&signalMaskSet);
+ posix_spawnattr_setsigmask(&attr, &signalMaskSet);
+ flags |= POSIX_SPAWN_SETSIGMASK;
+
+ // Set the architecture.
+ cpu_type_t cpuTypes[] = { (cpu_type_t)xpc_dictionary_get_uint64(event, "architecture") };
+ size_t outCount = 0;
+ posix_spawnattr_setbinpref_np(&attr, 1, cpuTypes, &outCount);
+
+ static const int allowExecutableHeapFlag = 0x2000;
+ if (xpc_dictionary_get_bool(event, "executable-heap"))
+ flags |= allowExecutableHeapFlag;
+
+ posix_spawnattr_setflags(&attr, flags);
+
+ char path[4 * PATH_MAX];
+ uint32_t pathLength = sizeof(path);
+ _NSGetExecutablePath(path, &pathLength);
+
+ // Setup the command line.
+ char** argv = *_NSGetArgv();
+ const char* programName = argv[0];
+ const char* args[] = { programName, 0 };
+
+ // Setup the environment.
+ xpc_object_t environmentArray = xpc_dictionary_get_value(event, "environment");
+ size_t numberOfEnvironmentVariables = xpc_array_get_count(environmentArray);
+
+ char** environment = (char**)malloc(numberOfEnvironmentVariables * sizeof(char*) + 1);
+ for (size_t i = 0; i < numberOfEnvironmentVariables; ++i) {
+ const char* string = xpc_array_get_string(environmentArray, i);
+ size_t stringLength = strlen(string);
+
+ char* environmentVariable = (char*)malloc(stringLength + 1);
+ memcpy(environmentVariable, string, stringLength);
+ environmentVariable[stringLength] = '\0';
+
+ environment[i] = environmentVariable;
+ }
+ environment[numberOfEnvironmentVariables] = 0;
+
+ pid_t processIdentifier = 0;
+ posix_spawn(&processIdentifier, path, 0, &attr, const_cast<char**>(args), environment);
+
+ posix_spawnattr_destroy(&attr);
+
+ NSLog(@"Unable to re-exec for path: %s\n", path);
+ exit(EXIT_FAILURE);
+ }
+
+ if (!strcmp(xpc_dictionary_get_string(event, "message-name"), "bootstrap")) {
+ static void* frameworkLibrary = dlopen(xpc_dictionary_get_string(event, "framework-executable-path"), RTLD_NOW);
+ if (!frameworkLibrary) {
+ NSLog(@"Unable to load WebKit2.framework: %s\n", dlerror());
+ exit(EXIT_FAILURE);
+ }
+
+ typedef void (*InitializeWebProcessFunction)(const char* clientIdentifer, xpc_connection_t connection, mach_port_t serverPort, const char* uiProcessName);
+ InitializeWebProcessFunction initializeWebProcessFunctionPtr = reinterpret_cast<InitializeWebProcessFunction>(dlsym(frameworkLibrary, "initializeWebProcessForWebProcessServiceForWebKitDevelopment"));
+ if (!initializeWebProcessFunctionPtr) {
+ NSLog(@"Unable to find entry point in WebKit2.framework: %s\n", dlerror());
+ exit(EXIT_FAILURE);
+ }
+
+ xpc_object_t reply = xpc_dictionary_create_reply(event);
+ xpc_dictionary_set_string(reply, "message-name", "process-finished-launching");
+ xpc_connection_send_message(xpc_dictionary_get_remote_connection(event), reply);
+ xpc_release(reply);
+
+ dup2(xpc_dictionary_dup_fd(event, "stdout"), STDOUT_FILENO);
+ dup2(xpc_dictionary_dup_fd(event, "stderr"), STDERR_FILENO);
+
+ initializeWebProcessFunctionPtr(xpc_dictionary_get_string(event, "client-identifier"), peer, xpc_dictionary_copy_mach_send(event, "server-port"), xpc_dictionary_get_string(event, "ui-process-name"));
+ }
+ }
+ });
+
+ xpc_connection_resume(peer);
+}
+
+int main(int argc, char** argv)
+{
+ xpc_main(WebProcessServiceForWebKitDevelopmentEventHandler);
+ return 0;;
+}
Deleted: trunk/Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/WebProcessServiceForWebKitDevelopmentMain.mm (140775 => 140870)
--- trunk/Source/WebKit2/WebProcessServiceForWebKitDevelopment/WebProcessServiceForWebKitDevelopmentMain.mm 2013-01-25 05:06:31 UTC (rev 140775)
+++ trunk/Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/WebProcessServiceForWebKitDevelopmentMain.mm 2013-01-25 23:22:15 UTC (rev 140870)
@@ -1,149 +0,0 @@
-/*
- * 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.
- */
-
-#import <AvailabilityMacros.h>
-
-#import <crt_externs.h>
-#import <dlfcn.h>
-#import <mach-o/dyld.h>
-#import <spawn.h>
-#import <stdio.h>
-#import <stdlib.h>
-#import <xpc/xpc.h>
-
-extern "C" mach_port_t xpc_dictionary_copy_mach_send(xpc_object_t, const char*);
-
-static void WebProcessServiceForWebKitDevelopmentEventHandler(xpc_connection_t peer)
-{
- xpc_connection_set_target_queue(peer, dispatch_get_main_queue());
- xpc_connection_set_event_handler(peer, ^(xpc_object_t event) {
- xpc_type_t type = xpc_get_type(event);
- if (type == XPC_TYPE_ERROR) {
- if (event == XPC_ERROR_CONNECTION_INVALID || event == XPC_ERROR_TERMINATION_IMMINENT) {
- // FIXME: Handle this case more gracefully.
- exit(EXIT_FAILURE);
- }
- } else {
- assert(type == XPC_TYPE_DICTIONARY);
-
- if (!strcmp(xpc_dictionary_get_string(event, "message-name"), "re-exec")) {
- // Setup the posix_spawn attributes.
- posix_spawnattr_t attr;
- posix_spawnattr_init(&attr);
-
- short flags = 0;
-
- // We just want to set the process state, not actually launch a new process,
- // so we are going to use the darwin extension to posix_spawn POSIX_SPAWN_SETEXEC
- // to act like a more full featured exec.
- flags |= POSIX_SPAWN_SETEXEC;
-
- // We want our process to receive all signals.
- sigset_t signalMaskSet;
- sigemptyset(&signalMaskSet);
- posix_spawnattr_setsigmask(&attr, &signalMaskSet);
- flags |= POSIX_SPAWN_SETSIGMASK;
-
- // Set the architecture.
- cpu_type_t cpuTypes[] = { (cpu_type_t)xpc_dictionary_get_uint64(event, "architecture") };
- size_t outCount = 0;
- posix_spawnattr_setbinpref_np(&attr, 1, cpuTypes, &outCount);
-
- static const int allowExecutableHeapFlag = 0x2000;
- if (xpc_dictionary_get_bool(event, "executable-heap"))
- flags |= allowExecutableHeapFlag;
-
- posix_spawnattr_setflags(&attr, flags);
-
- char path[4 * PATH_MAX];
- uint32_t pathLength = sizeof(path);
- _NSGetExecutablePath(path, &pathLength);
-
- // Setup the command line.
- char** argv = *_NSGetArgv();
- const char* programName = argv[0];
- const char* args[] = { programName, 0 };
-
- // Setup the environment.
- xpc_object_t environmentArray = xpc_dictionary_get_value(event, "environment");
- size_t numberOfEnvironmentVariables = xpc_array_get_count(environmentArray);
-
- char** environment = (char**)malloc(numberOfEnvironmentVariables * sizeof(char*) + 1);
- for (size_t i = 0; i < numberOfEnvironmentVariables; ++i) {
- const char* string = xpc_array_get_string(environmentArray, i);
- size_t stringLength = strlen(string);
-
- char* environmentVariable = (char*)malloc(stringLength + 1);
- memcpy(environmentVariable, string, stringLength);
- environmentVariable[stringLength] = '\0';
-
- environment[i] = environmentVariable;
- }
- environment[numberOfEnvironmentVariables] = 0;
-
- pid_t processIdentifier = 0;
- posix_spawn(&processIdentifier, path, 0, &attr, const_cast<char**>(args), environment);
-
- posix_spawnattr_destroy(&attr);
-
- NSLog(@"Unable to re-exec for path: %s\n", path);
- exit(EXIT_FAILURE);
- }
-
- if (!strcmp(xpc_dictionary_get_string(event, "message-name"), "bootstrap")) {
- static void* frameworkLibrary = dlopen(xpc_dictionary_get_string(event, "framework-executable-path"), RTLD_NOW);
- if (!frameworkLibrary) {
- NSLog(@"Unable to load WebKit2.framework: %s\n", dlerror());
- exit(EXIT_FAILURE);
- }
-
- typedef void (*InitializeWebProcessFunction)(const char* clientIdentifer, xpc_connection_t connection, mach_port_t serverPort, const char* uiProcessName);
- InitializeWebProcessFunction initializeWebProcessFunctionPtr = reinterpret_cast<InitializeWebProcessFunction>(dlsym(frameworkLibrary, "initializeWebProcessForWebProcessServiceForWebKitDevelopment"));
- if (!initializeWebProcessFunctionPtr) {
- NSLog(@"Unable to find entry point in WebKit2.framework: %s\n", dlerror());
- exit(EXIT_FAILURE);
- }
-
- xpc_object_t reply = xpc_dictionary_create_reply(event);
- xpc_dictionary_set_string(reply, "message-name", "process-finished-launching");
- xpc_connection_send_message(xpc_dictionary_get_remote_connection(event), reply);
- xpc_release(reply);
-
- dup2(xpc_dictionary_dup_fd(event, "stdout"), STDOUT_FILENO);
- dup2(xpc_dictionary_dup_fd(event, "stderr"), STDERR_FILENO);
-
- initializeWebProcessFunctionPtr(xpc_dictionary_get_string(event, "client-identifier"), peer, xpc_dictionary_copy_mach_send(event, "server-port"), xpc_dictionary_get_string(event, "ui-process-name"));
- }
- }
- });
-
- xpc_connection_resume(peer);
-}
-
-int main(int argc, char** argv)
-{
- xpc_main(WebProcessServiceForWebKitDevelopmentEventHandler);
- return 0;;
-}