- Revision
- 125361
- Author
- [email protected]
- Date
- 2012-08-11 22:29:41 -0700 (Sat, 11 Aug 2012)
Log Message
Enable XPC Service based WebProcess with runtime flag
https://bugs.webkit.org/show_bug.cgi?id=93773
Reviewed by Dan Bernstein.
Source/WebKit2:
Use the XPC Service for WebProcess code path if WEBKIT_USE_XPC_SERVICE_FOR_WEB_PROCESS
is set in the environment.
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::launchXPCService):
Fix issue that was causing this code not to compile. This was not caught before since
the code was not being built.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::connect):
Switch from hard coding always using the XPC Service code path if
HAVE(XPC) was true, to doing it conditionally on an environment variable.
Source/WTF:
* wtf/Platform.h:
Define HAVE_XPC on 10.7 and later.
Tools:
Convert --use-web-process-xpc-service passed to run-safari (and similar scripts)
to setting WEBKIT_USE_XPC_SERVICE_FOR_WEB_PROCESS=YES in the environment and setting
up __XPC_DYLD_FRAMEWORK_PATH and __XPC_DYLD_INSERT_LIBRARIES variables. NOTE: using
the XPC service is not the default code path.
* Scripts/webkitdirs.pm:
(shouldUseXPCServiceForWebProcess):
(determineShouldUseXPCServiceForWebProcess):
Add functions to extract --use-web-process-xpc-service from ARGV and set a
global variable.
(printHelpAndExitForRunAndDebugWebKitAppIfNeeded):
Add help text for --use-web-process-xpc-service.
(runMacWebKitApp):
Set the WEBKIT_USE_XPC_SERVICE_FOR_WEB_PROCESS environment variable and DYLD
if --use-web-process-xpc-service was passed on the command line.
(execMacWebKitAppForDebugging):
Set the WEBKIT_USE_XPC_SERVICE_FOR_WEB_PROCESS environment variable and DYLD
if --use-web-process-xpc-service was passed on the command line. Also, bail
if both --use-web-process-xpc-service and --target-web-process are passed on
the command line, as we don't currently support using both.
Modified Paths
Diff
Modified: trunk/Source/WTF/ChangeLog (125360 => 125361)
--- trunk/Source/WTF/ChangeLog 2012-08-12 04:52:02 UTC (rev 125360)
+++ trunk/Source/WTF/ChangeLog 2012-08-12 05:29:41 UTC (rev 125361)
@@ -1,3 +1,13 @@
+2012-08-11 Sam Weinig <[email protected]>
+
+ Enable XPC Service based WebProcess with runtime flag
+ https://bugs.webkit.org/show_bug.cgi?id=93773
+
+ Reviewed by Dan Bernstein.
+
+ * wtf/Platform.h:
+ Define HAVE_XPC on 10.7 and later.
+
2012-08-11 Benjamin Poulain <[email protected]>
Do the DecimalNumber to String conversion on 8 bits
Modified: trunk/Source/WTF/wtf/Platform.h (125360 => 125361)
--- trunk/Source/WTF/wtf/Platform.h 2012-08-12 04:52:02 UTC (rev 125360)
+++ trunk/Source/WTF/wtf/Platform.h 2012-08-12 05:29:41 UTC (rev 125361)
@@ -532,6 +532,7 @@
#define ENABLE_GESTURE_EVENTS 1
#define ENABLE_RUBBER_BANDING 1
#define WTF_USE_SCROLLBAR_PAINTER 1
+#define HAVE_XPC 1
#endif
#if !defined(ENABLE_JAVA_BRIDGE)
#define ENABLE_JAVA_BRIDGE 1
Modified: trunk/Source/WebKit2/ChangeLog (125360 => 125361)
--- trunk/Source/WebKit2/ChangeLog 2012-08-12 04:52:02 UTC (rev 125360)
+++ trunk/Source/WebKit2/ChangeLog 2012-08-12 05:29:41 UTC (rev 125361)
@@ -1,5 +1,25 @@
2012-08-11 Sam Weinig <[email protected]>
+ Enable XPC Service based WebProcess with runtime flag
+ https://bugs.webkit.org/show_bug.cgi?id=93773
+
+ Reviewed by Dan Bernstein.
+
+ Use the XPC Service for WebProcess code path if WEBKIT_USE_XPC_SERVICE_FOR_WEB_PROCESS
+ is set in the environment.
+
+ * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
+ (WebKit::launchXPCService):
+ Fix issue that was causing this code not to compile. This was not caught before since
+ the code was not being built.
+
+ * UIProcess/WebProcessProxy.cpp:
+ (WebKit::WebProcessProxy::connect):
+ Switch from hard coding always using the XPC Service code path if
+ HAVE(XPC) was true, to doing it conditionally on an environment variable.
+
+2012-08-11 Sam Weinig <[email protected]>
+
Make it possible to run the WebProcess as an XPC service
https://bugs.webkit.org/show_bug.cgi?id=92814
Modified: trunk/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm (125360 => 125361)
--- trunk/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm 2012-08-12 04:52:02 UTC (rev 125360)
+++ trunk/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm 2012-08-12 05:29:41 UTC (rev 125361)
@@ -120,12 +120,12 @@
// And the receive right.
mach_port_mod_refs(mach_task_self(), listeningPort, MACH_PORT_RIGHT_RECEIVE, -1);
-
- RunLoop::main()->dispatch(bind(didFinishLaunchingProcessFunction, this, 0, CoreIPC::Connection::Identifier()));
+
+ RunLoop::main()->dispatch(bind(didFinishLaunchingProcessFunction, that, 0, CoreIPC::Connection::Identifier()));
} else {
ASSERT(type == XPC_TYPE_DICTIONARY);
ASSERT(!strcmp(xpc_dictionary_get_string(reply, "message-name"), "process-finished-launching"));
-
+
// The process has finished launching, grab the pid from the connection.
pid_t processIdentifier = xpc_connection_get_pid(connection);
Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp (125360 => 125361)
--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp 2012-08-12 04:52:02 UTC (rev 125360)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp 2012-08-12 05:29:41 UTC (rev 125361)
@@ -111,7 +111,7 @@
launchOptions.architecture = ProcessLauncher::LaunchOptions::MatchCurrentArchitecture;
launchOptions.executableHeap = false;
#if HAVE(XPC)
- launchOptions.useXPC = true; // FIXME: This needs to be configurable.
+ launchOptions.useXPC = getenv("WEBKIT_USE_XPC_SERVICE_FOR_WEB_PROCESS");
#endif
#endif
#ifndef NDEBUG
Modified: trunk/Tools/ChangeLog (125360 => 125361)
--- trunk/Tools/ChangeLog 2012-08-12 04:52:02 UTC (rev 125360)
+++ trunk/Tools/ChangeLog 2012-08-12 05:29:41 UTC (rev 125361)
@@ -1,3 +1,34 @@
+2012-08-11 Sam Weinig <[email protected]>
+
+ Enable XPC Service based WebProcess with runtime flag
+ https://bugs.webkit.org/show_bug.cgi?id=93773
+
+ Reviewed by Dan Bernstein.
+
+ Convert --use-web-process-xpc-service passed to run-safari (and similar scripts)
+ to setting WEBKIT_USE_XPC_SERVICE_FOR_WEB_PROCESS=YES in the environment and setting
+ up __XPC_DYLD_FRAMEWORK_PATH and __XPC_DYLD_INSERT_LIBRARIES variables. NOTE: using
+ the XPC service is not the default code path.
+
+ * Scripts/webkitdirs.pm:
+ (shouldUseXPCServiceForWebProcess):
+ (determineShouldUseXPCServiceForWebProcess):
+ Add functions to extract --use-web-process-xpc-service from ARGV and set a
+ global variable.
+
+ (printHelpAndExitForRunAndDebugWebKitAppIfNeeded):
+ Add help text for --use-web-process-xpc-service.
+
+ (runMacWebKitApp):
+ Set the WEBKIT_USE_XPC_SERVICE_FOR_WEB_PROCESS environment variable and DYLD
+ if --use-web-process-xpc-service was passed on the command line.
+
+ (execMacWebKitAppForDebugging):
+ Set the WEBKIT_USE_XPC_SERVICE_FOR_WEB_PROCESS environment variable and DYLD
+ if --use-web-process-xpc-service was passed on the command line. Also, bail
+ if both --use-web-process-xpc-service and --target-web-process are passed on
+ the command line, as we don't currently support using both.
+
2012-08-11 Gyuyoung Kim <[email protected]>
[EFL] Bump harfbuzz dependency to v0.9.2
Modified: trunk/Tools/Scripts/webkitdirs.pm (125360 => 125361)
--- trunk/Tools/Scripts/webkitdirs.pm 2012-08-12 04:52:02 UTC (rev 125360)
+++ trunk/Tools/Scripts/webkitdirs.pm 2012-08-12 05:29:41 UTC (rev 125361)
@@ -105,6 +105,7 @@
my $isInspectorFrontend;
my $isWK2;
my $shouldTargetWebProcess;
+my $shouldUseXPCServiceForWebProcess;
my $shouldUseGuardMalloc;
my $xcodeVersion;
@@ -1441,6 +1442,18 @@
$shouldTargetWebProcess = checkForArgumentAndRemoveFromARGV("--target-web-process");
}
+sub shouldUseXPCServiceForWebProcess
+{
+ determineShouldUseXPCServiceForWebProcess();
+ return $shouldUseXPCServiceForWebProcess;
+}
+
+sub determineShouldUseXPCServiceForWebProcess
+{
+ return if defined($shouldUseXPCServiceForWebProcess);
+ $shouldUseXPCServiceForWebProcess = checkForArgumentAndRemoveFromARGV("--use-web-process-xpc-service");
+}
+
sub debugger
{
determineDebugger();
@@ -1480,6 +1493,9 @@
if ($shouldUseGuardMalloc) {
appendToEnvironmentVariableList("DYLD_INSERT_LIBRARIES", "/usr/lib/libgmalloc.dylib");
+ if (shouldUseXPCServiceForWebProcess()) {
+ appendToEnvironmentVariableList("__XPC_DYLD_INSERT_LIBRARIES", "/usr/lib/libgmalloc.dylib");
+ }
}
}
@@ -2678,15 +2694,16 @@
print STDERR <<EOF;
Usage: @{[basename($0)]} [options] [args ...]
- --help Show this help message
- --no-saved-state Disable application resume for the session on Mac OS 10.7
- --guard-malloc Enable Guard Malloc (Mac OS X only)
+ --help Show this help message
+ --no-saved-state Disable application resume for the session on Mac OS 10.7
+ --guard-malloc Enable Guard Malloc (OS X only)
+ --use-web-process-xpc-service Launch the Web Process as an XPC Service (OS X only)
EOF
if ($includeOptionsForDebugging) {
print STDERR <<EOF;
- --target-web-process Debug the web process
- --use-lldb Use LLDB
+ --target-web-process Debug the web process
+ --use-lldb Use LLDB
EOF
}
@@ -2710,6 +2727,12 @@
setUpGuardMallocIfNeeded();
+ if (shouldUseXPCServiceForWebProcess()) {
+ $ENV{__XPC_DYLD_FRAMEWORK_PATH} = $productDir;
+ appendToEnvironmentVariableList("__XPC_DYLD_INSERT_LIBRARIES", File::Spec->catfile($productDir, "WebProcessShim.dylib"));
+ $ENV{WEBKIT_USE_XPC_SERVICE_FOR_WEB_PROCESS} = "YES";
+ }
+
if (defined($useOpenCommand) && $useOpenCommand == USE_OPEN_COMMAND) {
return system("open", "-W", "-a", $appPath, "--args", argumentsForRunAndDebugMacWebKitApp());
}
@@ -2747,9 +2770,18 @@
my @architectureFlags = ($architectureSwitch, architecture());
if (!shouldTargetWebProcess()) {
+ if (shouldUseXPCServiceForWebProcess()) {
+ $ENV{__XPC_DYLD_FRAMEWORK_PATH} = $productDir;
+ appendToEnvironmentVariableList("__XPC_DYLD_INSERT_LIBRARIES", File::Spec->catfile($productDir, "WebProcessShim.dylib"));
+ $ENV{WEBKIT_USE_XPC_SERVICE_FOR_WEB_PROCESS} = "YES";
+ }
print "Starting @{[basename($appPath)]} under $debugger with DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n";
exec { $debuggerPath } $debuggerPath, @architectureFlags, $argumentsSeparator, $appPath, argumentsForRunAndDebugMacWebKitApp() or die;
} else {
+ if (shouldUseXPCServiceForWebProcess()) {
+ die "Targetting the Web Process is not compatible with using an XPC Service for the Web Process at this time.";
+ }
+
my $webProcessShimPath = File::Spec->catfile($productDir, "WebProcessShim.dylib");
my $webProcessPath = File::Spec->catdir($productDir, "WebProcess.app");
my $webKit2ExecutablePath = File::Spec->catfile($productDir, "WebKit2.framework", "WebKit2");