Commit 7f2f86c3 authored by weinig@apple.com's avatar weinig@apple.com

WebKit2 should launch the WebProcess in 32-bit mode if the UIProcess is in 32-bit mode

<rdar://problem/8348100>
https://bugs.webkit.org/show_bug.cgi?id=44537

Reviewed by Mark Rowe.

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess): Use posix_spawnattr_setbinpref_np
to tell posix_spawn to launch the WebProcess in 32-bit mode when the UIProcess
is running in 32-bit mode.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65968 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent dd6ec3e5
2010-08-24 Sam Weinig <sam@webkit.org>
Reviewed by Mark Rowe.
WebKit2 should launch the WebProcess in 32-bit mode if the UIProcess is in 32-bit mode
<rdar://problem/8348100>
https://bugs.webkit.org/show_bug.cgi?id=44537
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess): Use posix_spawnattr_setbinpref_np
to tell posix_spawn to launch the WebProcess in 32-bit mode when the UIProcess
is running in 32-bit mode.
2010-08-24 Mark Rowe <mrowe@apple.com>
Rubber-stamped by Sam Weinig.
......
......@@ -29,6 +29,7 @@
#include "WebProcess.h"
#include "WebSystemInterface.h"
#include <crt_externs.h>
#include <mach/machine.h>
#include <runtime/InitializeThreading.h>
#include <servers/bootstrap.h>
#include <spawn.h>
......@@ -66,9 +67,22 @@ void ProcessLauncher::launchProcess()
kern_return_t kr = bootstrap_register2(bootstrap_port, const_cast<char*>(serviceName.data()), listeningPort, 0);
if (kr)
NSLog(@"bootstrap_register2 result: %x", kr);
posix_spawnattr_t attr;
posix_spawnattr_init(&attr);
#if CPU(X86)
// Ensure that the child process runs as the same architecture as the parent process.
cpu_type_t cpuTypes[] = { CPU_TYPE_X86 };
size_t outCount = 0;
posix_spawnattr_setbinpref_np(&attr, 1, cpuTypes, &outCount);
#endif
pid_t processIdentifier;
int result = posix_spawn(&processIdentifier, path, 0, 0, (char *const*)args, *_NSGetEnviron());
int result = posix_spawn(&processIdentifier, path, 0, &attr, (char *const*)args, *_NSGetEnviron());
posix_spawnattr_destroy(&attr);
if (result)
NSLog(@"posix_spawn result: %d", result);
......@@ -87,7 +101,7 @@ void ProcessLauncher::terminateProcess()
static void* webThreadBody(void* context)
{
mach_port_t serverPort = static_cast<mach_port_t>(reinterpret_cast<uintptr_t>(context));
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
InitWebCoreSystemInterface();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment