Use XPC services in the iOS Simulator, but not in Mountain Lion
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Apr 2014 20:10:49 +0000 (20:10 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Apr 2014 20:10:49 +0000 (20:10 +0000)
https://bugs.webkit.org/show_bug.cgi?id=131894

Reviewed by Anders Carlsson.

* Configurations/NetworkService.Development.xcconfig: Defined INFOPLIST_FILE for the
Simulator.
* Configurations/NetworkService.xcconfig: Ditto.
* Configurations/WebContentService.Development.xcconfig: Ditto.
* Configurations/WebContentService.xcconfig: Ditto.
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::systemDirectoryPath): Added this helper function that returns a slash-terminated
path to the System directory in the current runtime.
(WebKit::ProcessLauncher::launchProcess): Changed to use the above function to tell whether
a development version of WebKit2 is being used.
* WebKit2Prefix.h: Set WTF_USE_XPC_SERVICES to 1 when targeting the iOS Simulator, but not
when targeting Mountain Lion.

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

Source/WebKit2/ChangeLog
Source/WebKit2/Configurations/NetworkService.Development.xcconfig
Source/WebKit2/Configurations/NetworkService.xcconfig
Source/WebKit2/Configurations/WebContentService.Development.xcconfig
Source/WebKit2/Configurations/WebContentService.xcconfig
Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm
Source/WebKit2/WebKit2Prefix.h

index 4448991..756f09f 100644 (file)
@@ -1,5 +1,25 @@
 2014-04-19  Dan Bernstein  <mitz@apple.com>
 
+        Use XPC services in the iOS Simulator, but not in Mountain Lion
+        https://bugs.webkit.org/show_bug.cgi?id=131894
+
+        Reviewed by Anders Carlsson.
+
+        * Configurations/NetworkService.Development.xcconfig: Defined INFOPLIST_FILE for the
+        Simulator.
+        * Configurations/NetworkService.xcconfig: Ditto.
+        * Configurations/WebContentService.Development.xcconfig: Ditto.
+        * Configurations/WebContentService.xcconfig: Ditto.
+        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
+        (WebKit::systemDirectoryPath): Added this helper function that returns a slash-terminated
+        path to the System directory in the current runtime.
+        (WebKit::ProcessLauncher::launchProcess): Changed to use the above function to tell whether
+        a development version of WebKit2 is being used.
+        * WebKit2Prefix.h: Set WTF_USE_XPC_SERVICES to 1 when targeting the iOS Simulator, but not
+        when targeting Mountain Lion.
+
+2014-04-19  Dan Bernstein  <mitz@apple.com>
+
         [Cocoa] Crash in -[WKWebProcessPlugInHitTestResult nodeHandle] when nodeHandle() is null
         https://bugs.webkit.org/show_bug.cgi?id=131888
 
index 9b9556f..93cd8a8 100644 (file)
@@ -29,6 +29,7 @@ PRODUCT_NAME = com.apple.WebKit.Networking.Development;
 INFOPLIST_FILE = $(INFOPLIST_FILE_$(PLATFORM_NAME));
 INFOPLIST_FILE_macosx = NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/Info-OSX.plist;
 INFOPLIST_FILE_iphoneos = NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/Info-iOS.plist;
+INFOPLIST_FILE_iphonesimulator = $(INFOPLIST_FILE_iphoneos);
 
 CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*] = Configurations/Network-iOS.entitlements
 CODE_SIGN_ENTITLEMENTS[sdk=iphonesimulator*] = Configurations/Network-iOS.entitlements
index d1bd483..26f8683 100644 (file)
@@ -29,6 +29,7 @@ PRODUCT_NAME = com.apple.WebKit.Networking;
 INFOPLIST_FILE = $(INFOPLIST_FILE_$(PLATFORM_NAME));
 INFOPLIST_FILE_macosx = NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist;
 INFOPLIST_FILE_iphoneos = NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist;
+INFOPLIST_FILE_iphonesimulator = $(INFOPLIST_FILE_iphoneos);
 
 CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*] = Configurations/Network-iOS.entitlements
 CODE_SIGN_ENTITLEMENTS[sdk=iphonesimulator*] = Configurations/Network-iOS.entitlements
index 8536fc7..67918e1 100644 (file)
@@ -29,6 +29,7 @@ PRODUCT_NAME = com.apple.WebKit.WebContent.Development;
 INFOPLIST_FILE = $(INFOPLIST_FILE_$(PLATFORM_NAME));
 INFOPLIST_FILE_macosx = WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-OSX.plist;
 INFOPLIST_FILE_iphoneos = WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-iOS.plist;
+INFOPLIST_FILE_iphonesimulator = $(INFOPLIST_FILE_iphoneos);
 
 CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*] = Configurations/WebContent-iOS.entitlements
 
index 4f12222..ceebe5d 100644 (file)
 WK_XPC_SERVICE_VARIANT = Normal;
 
 PRODUCT_NAME = com.apple.WebKit.WebContent;
-
 INFOPLIST_FILE = $(INFOPLIST_FILE_$(PLATFORM_NAME));
 INFOPLIST_FILE_macosx = WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist;
 INFOPLIST_FILE_iphoneos = WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist;
+INFOPLIST_FILE_iphonesimulator = $(INFOPLIST_FILE_iphoneos);
 
 CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*] = Configurations/WebContent-iOS.entitlements
 
index 6d0cfd4..4379a6d 100644 (file)
@@ -501,12 +501,26 @@ static void createProcess(const ProcessLauncher::LaunchOptions& launchOptions, b
     RunLoop::main().dispatch(bind(didFinishLaunchingProcessFunction, that, processIdentifier, IPC::Connection::Identifier(listeningPort)));
 }
 
+static NSString *systemDirectoryPath()
+{
+    static NSString *path = [^{
+#if PLATFORM(IOS_SIMULATOR)
+        char *simulatorRoot = getenv("SIMULATOR_ROOT");
+        return simulatorRoot ? [NSString stringWithFormat:@"%s/System/", simulatorRoot] : @"/System/";
+#else
+        return @"/System/";
+#endif
+    }() copy];
+
+    return path;
+}
+
 void ProcessLauncher::launchProcess()
 {
     if (tryPreexistingProcess(m_launchOptions, this, &ProcessLauncher::didFinishLaunchingProcess))
         return;
 
-    bool isWebKitDevelopmentBuild = ![[[[NSBundle bundleWithIdentifier:@"com.apple.WebKit2"] bundlePath] stringByDeletingLastPathComponent] hasPrefix:@"/System/"];
+    bool isWebKitDevelopmentBuild = ![[[[NSBundle bundleWithIdentifier:@"com.apple.WebKit2"] bundlePath] stringByDeletingLastPathComponent] hasPrefix:systemDirectoryPath()];
 
     if (m_launchOptions.useXPC) {
         createService(m_launchOptions, isWebKitDevelopmentBuild, this, &ProcessLauncher::didFinishLaunchingProcess);
index af40243..f97a808 100644 (file)
@@ -64,7 +64,7 @@
 #define ENABLE_SHARED_WORKER_PROCESS 1
 #endif
 
-#if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090) || !PLATFORM(IOS_SIMULATOR)
+#if !(defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED == 1080)
 #define WTF_USE_XPC_SERVICES 1
 #endif