Title: [129295] trunk/Source/WebKit2
Revision
129295
Author
[email protected]
Date
2012-09-21 20:18:33 -0700 (Fri, 21 Sep 2012)

Log Message

Fix the Lion and Snow Leopard builds.

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::connectToWebProcessServiceForWebKitDevelopment):
(WebKit::createWebProcessServiceForWebKitDevelopment):
(WebKit::createWebProcessService):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (129294 => 129295)


--- trunk/Source/WebKit2/ChangeLog	2012-09-22 03:04:16 UTC (rev 129294)
+++ trunk/Source/WebKit2/ChangeLog	2012-09-22 03:18:33 UTC (rev 129295)
@@ -1,5 +1,14 @@
 2012-09-21  Sam Weinig  <[email protected]>
 
+        Fix the Lion and Snow Leopard builds.
+
+        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
+        (WebKit::connectToWebProcessServiceForWebKitDevelopment):
+        (WebKit::createWebProcessServiceForWebKitDevelopment):
+        (WebKit::createWebProcessService):
+
+2012-09-21  Sam Weinig  <[email protected]>
+
         WebProcess XPC services need have their environment set without disrupting all other XPC services
         https://bugs.webkit.org/show_bug.cgi?id=95161
 

Modified: trunk/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm (129294 => 129295)


--- trunk/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm	2012-09-22 03:04:16 UTC (rev 129294)
+++ trunk/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm	2012-09-22 03:18:33 UTC (rev 129295)
@@ -61,6 +61,24 @@
 
 namespace WebKit {
 
+namespace {
+
+struct UUIDHolder : public RefCounted<UUIDHolder> {
+    static PassRefPtr<UUIDHolder> create()
+    {
+        return adoptRef(new UUIDHolder);
+    }
+
+    UUIDHolder()
+    {
+        uuid_generate(uuid);
+    }
+
+    uuid_t uuid;
+};
+
+}
+
 static void setUpTerminationNotificationHandler(pid_t pid)
 {
 #if HAVE(DISPATCH_H)
@@ -115,15 +133,12 @@
 typedef void (ProcessLauncher::*DidFinishLaunchingProcessFunction)(PlatformProcessIdentifier, CoreIPC::Connection::Identifier);
 
 #if HAVE(XPC)
-static void connectToWebProcessServiceForWebKitDevelopment(const ProcessLauncher::LaunchOptions&, ProcessLauncher* that, DidFinishLaunchingProcessFunction didFinishLaunchingProcessFunction, RetainPtr<NSUUID> instanceUUID)
+static void connectToWebProcessServiceForWebKitDevelopment(const ProcessLauncher::LaunchOptions&, ProcessLauncher* that, DidFinishLaunchingProcessFunction didFinishLaunchingProcessFunction, UUIDHolder* instanceUUID)
 {
     // Create a connection to the WebKit2 XPC service.
     xpc_connection_t connection = xpc_connection_create("com.apple.WebKit2.WebProcessServiceForWebKitDevelopment", 0);
+    xpc_connection_set_instance(connection, instanceUUID->uuid);
 
-    uuid_t uuidBytes;
-    [instanceUUID.get() getUUIDBytes:uuidBytes];
-    xpc_connection_set_instance(connection, uuidBytes);
-
     // XPC requires having an event handler, even if it is not used.
     xpc_connection_set_event_handler(connection, ^(xpc_object_t event) { });
     xpc_connection_resume(connection);
@@ -179,14 +194,11 @@
 
     // Generate the uuid for the service instance we are about to create.
     // FIXME: This UUID should be stored on the WebProcessProxy.
-    RetainPtr<NSUUID> instanceUUID = adoptNS([[NSUUID alloc] init]);
+    RefPtr<UUIDHolder> instanceUUID = UUIDHolder::create();
 
     xpc_connection_t reExecConnection = xpc_connection_create("com.apple.WebKit2.WebProcessServiceForWebKitDevelopment", 0);
+    xpc_connection_set_instance(reExecConnection, instanceUUID->uuid);
 
-    uuid_t uuidBytes;
-    [instanceUUID.get() getUUIDBytes:uuidBytes];
-    xpc_connection_set_instance(reExecConnection, uuidBytes);
-
     // Keep the ProcessLauncher alive while we do the re-execing (balanced in event handler).
     that->ref();
 
@@ -196,7 +208,7 @@
     xpc_connection_set_event_handler(reExecConnection, ^(xpc_object_t event) {
         ASSERT(xpc_get_type(event) == XPC_TYPE_ERROR);
 
-        connectToWebProcessServiceForWebKitDevelopment(launchOptions, that, didFinishLaunchingProcessFunction, instanceUUID);
+        connectToWebProcessServiceForWebKitDevelopment(launchOptions, that, didFinishLaunchingProcessFunction, instanceUUID.get());
 
         // Release the connection.
         xpc_release(reExecConnection);
@@ -236,15 +248,12 @@
 {
     // Generate the uuid for the service instance we are about to create.
     // FIXME: This UUID should be stored on the WebProcessProxy.
-    RetainPtr<NSUUID> instanceUUID = adoptNS([[NSUUID alloc] init]);
+    RefPtr<UUIDHolder> instanceUUID = UUIDHolder::create();
 
     // Create a connection to the WebKit2 XPC service.
     xpc_connection_t connection = xpc_connection_create("com.apple.WebKit2.WebProcessService", 0);
+    xpc_connection_set_instance(connection, instanceUUID->uuid);
 
-    uuid_t uuidBytes;
-    [instanceUUID.get() getUUIDBytes:uuidBytes];
-    xpc_connection_set_instance(connection, uuidBytes);
-
     // XPC requires having an event handler, even if it is not used.
     xpc_connection_set_event_handler(connection, ^(xpc_object_t event) { });
     xpc_connection_resume(connection);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to