[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

andersca at apple.com andersca at apple.com
Wed Dec 22 11:25:17 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit ae7a54c0d33fc247b69698a393d3aac4018642e6
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jul 22 22:18:50 2010 +0000

    It should be possible to attach to the WebProcess in gdb during startup
    https://bugs.webkit.org/show_bug.cgi?id=42853
    
    Reviewed by Adam Roben.
    
    Create an unique bootstrap service name and pass it to the web process, instead of registering a per process
    name (which was incorrect anyway). This lets us get rid of the requirement that the UI process always should be
    the parent process of the web process, something which is false when running under the debugger.
    
    * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
    (WebKit::ProcessLauncher::launchProcess):
    * WebProcess/mac/WebProcessMainMac.mm:
    (WebKit::WebProcessMain):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63917 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 0abb0ac..7debe03 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,5 +1,21 @@
 2010-07-22  Anders Carlsson  <andersca at apple.com>
 
+        Reviewed by Adam Roben.
+
+        It should be possible to attach to the WebProcess in gdb during startup
+        https://bugs.webkit.org/show_bug.cgi?id=42853
+
+        Create an unique bootstrap service name and pass it to the web process, instead of registering a per process
+        name (which was incorrect anyway). This lets us get rid of the requirement that the UI process always should be
+        the parent process of the web process, something which is false when running under the debugger.
+
+        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
+        (WebKit::ProcessLauncher::launchProcess):
+        * WebProcess/mac/WebProcessMainMac.mm:
+        (WebKit::WebProcessMain):
+
+2010-07-22  Anders Carlsson  <andersca at apple.com>
+
         Reviewed by Sam Weinig.
 
         Don't assert when Connection::invalidate is called before Connection::dispatchConnectionDidClose
diff --git a/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm b/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm
index d3b27c0..b0edce0 100644
--- a/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm
+++ b/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm
@@ -28,13 +28,16 @@
 #include "RunLoop.h"
 #include "WebProcess.h"
 #include "WebSystemInterface.h"
-
+#include <WebCore/PlatformString.h>
 #include <crt_externs.h>
 #include <runtime/InitializeThreading.h>
 #include <servers/bootstrap.h>
 #include <spawn.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/Threading.h>
+#include <wtf/text/CString.h>
+
+using namespace WebCore;
 
 // FIXME: We should be doing this another way.
 extern "C" kern_return_t bootstrap_register2(mach_port_t, name_t, mach_port_t, uint64_t);
@@ -53,11 +56,14 @@ void ProcessLauncher::launchProcess()
     NSString *webProcessAppPath = [[NSBundle bundleWithIdentifier:@"com.apple.WebKit2"] pathForAuxiliaryExecutable:@"WebProcess.app"];
     NSString *webProcessAppExecutablePath = [[NSBundle bundleWithPath:webProcessAppPath] executablePath];
 
+    // Make a unique, per pid, per process launcher web process service name.
+    CString serviceName = String::format("com.apple.WebKit.WebProcess-%d-%p", getpid(), this).utf8();
+
     const char* path = [webProcessAppExecutablePath fileSystemRepresentation];
-    const char* args[] = { path, "-mode", "legacywebprocess", 0 };
+    const char* args[] = { path, "-mode", "legacywebprocess", "-servicename", serviceName.data(), 0 };
 
     // Register ourselves.
-    kern_return_t kr = bootstrap_register2(bootstrap_port, (char*)"com.apple.WebKit.WebProcess", listeningPort, /* BOOTSTRAP_PER_PID_SERVICE */ 1);
+    kern_return_t kr = bootstrap_register2(bootstrap_port, const_cast<char*>(serviceName.data()), listeningPort, 0);
     if (kr)
         NSLog(@"bootstrap_register2 result: %x", kr);
     
diff --git a/WebKit2/WebProcess/mac/WebProcessMainMac.mm b/WebKit2/WebProcess/mac/WebProcessMainMac.mm
index 3d3a8ce..c8848d5 100644
--- a/WebKit2/WebProcess/mac/WebProcessMainMac.mm
+++ b/WebKit2/WebProcess/mac/WebProcessMainMac.mm
@@ -38,6 +38,7 @@
 #import <sysexits.h>
 #import <unistd.h>
 #import <wtf/Threading.h>
+#import <wtf/text/CString.h>
 
 #if ENABLE(WEB_PROCESS_SANDBOX)
 #import <sandbox.h>
@@ -52,7 +53,7 @@ using namespace WebCore;
 
 namespace WebKit {
 
-int WebProcessMain(CommandLine*)
+int WebProcessMain(CommandLine* commandLine)
 {
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 
@@ -68,8 +69,13 @@ int WebProcessMain(CommandLine*)
     }
 #endif
 
+    String serviceName = (*commandLine)["servicename"];
+    if (serviceName.isEmpty())
+        return EXIT_FAILURE;
+
+    // Get the server port.
     mach_port_t serverPort;
-    kern_return_t kr = bootstrap_look_up2(bootstrap_port, "com.apple.WebKit.WebProcess", &serverPort, getppid(), /* BOOTSTRAP_PER_PID_SERVICE */ 1);
+    kern_return_t kr = bootstrap_look_up2(bootstrap_port, serviceName.utf8().data(), &serverPort, 0, 0);
     if (kr) {
         printf("bootstrap_look_up2 result: %x", kr);
         return 2;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list