Add a pre-bootstrap message for NetworkProcess XPC service
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Mar 2013 04:18:44 +0000 (04:18 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Mar 2013 04:18:44 +0000 (04:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=111127

Patch by Kiran Muppala <cmuppala@apple.com> on 2013-02-28
Reviewed by Sam Weinig.

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
(WebKit::XPCServiceEventHandler): Hold on to the pre-bootstrap message.
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
(WebKit::XPCServiceEventHandler): Ditto.
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::connectToService): Send a pre-bootstrap message for NetworkProcess
XPC service.

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

Source/WebKit2/ChangeLog
Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm
Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm
Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm

index b787396..98dd54c 100644 (file)
@@ -1,3 +1,18 @@
+2013-02-28  Kiran Muppala  <cmuppala@apple.com>
+
+        Add a pre-bootstrap message for NetworkProcess XPC service
+        https://bugs.webkit.org/show_bug.cgi?id=111127
+
+        Reviewed by Sam Weinig.
+
+        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
+        (WebKit::XPCServiceEventHandler): Hold on to the pre-bootstrap message.
+        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
+        (WebKit::XPCServiceEventHandler): Ditto.
+        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
+        (WebKit::connectToService): Send a pre-bootstrap message for NetworkProcess
+        XPC service.
+
 2013-02-28  Conrad Shultz  <conrad_shultz@apple.com>
 
         Need API to control page underlay color
 2013-02-28  Conrad Shultz  <conrad_shultz@apple.com>
 
         Need API to control page underlay color
index dea44c5..ec752be 100644 (file)
@@ -124,6 +124,11 @@ static void XPCServiceEventHandler(xpc_connection_t peer)
 
                 initializerFunctionPtr(peer, event);
             }
 
                 initializerFunctionPtr(peer, event);
             }
+
+            if (!strcmp(xpc_dictionary_get_string(event, "message-name"), "pre-bootstrap")) {
+                // Hold on to the pre-bootstrap message.
+                xpc_retain(event);
+            }
         }
     });
 
         }
     });
 
index 3cdab9c..d30adae 100644 (file)
@@ -59,6 +59,11 @@ static void XPCServiceEventHandler(xpc_connection_t peer)
 
                 initializerFunctionPtr(peer, event);
             }
 
                 initializerFunctionPtr(peer, event);
             }
+
+            if (!strcmp(xpc_dictionary_get_string(event, "message-name"), "pre-bootstrap")) {
+                // Hold on to the pre-bootstrap message.
+                xpc_retain(event);
+            }
         }
     });
 
         }
     });
 
index 63758bb..7b2edc8 100644 (file)
@@ -188,6 +188,15 @@ static void connectToService(const ProcessLauncher::LaunchOptions& launchOptions
     xpc_connection_set_event_handler(connection, ^(xpc_object_t event) { });
     xpc_connection_resume(connection);
 
     xpc_connection_set_event_handler(connection, ^(xpc_object_t event) { });
     xpc_connection_resume(connection);
 
+#if ENABLE(NETWORK_PROCESS)
+    if (launchOptions.processType == ProcessLauncher::NetworkProcess) {
+        xpc_object_t preBootstrapMessage = xpc_dictionary_create(0, 0, 0);
+        xpc_dictionary_set_string(preBootstrapMessage, "message-name", "pre-bootstrap");
+        xpc_connection_send_message(connection, preBootstrapMessage);
+        xpc_release(preBootstrapMessage);
+    }
+#endif
+
     // Create the listening port.
     mach_port_t listeningPort;
     mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &listeningPort);
     // Create the listening port.
     mach_port_t listeningPort;
     mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &listeningPort);