[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 13:18:56 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 723482f020a44787b0bdd6e44d6cf6406b0ae570
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Sep 10 22:52:29 2010 +0000
WebKit2: Set the visible name for the web process
https://bugs.webkit.org/show_bug.cgi?id=45564
<rdar://problem/8416970>
Reviewed by Mark Rowe and Darin Adler.
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::processName):
Add a thread safe implementation of -[NSProcessInfo processName].
(WebKit::ProcessLauncher::launchProcess):
Pass the process name to the child process.
* WebProcess/mac/WebProcessMainMac.mm:
(WebKit::WebProcessMain):
Set the visible name.
WebKitLibraries: WebKitSystemInterface part of:
Set the visible name for the web process
https://bugs.webkit.org/show_bug.cgi?id=45564
<rdar://problem/8416970>
* WebKitSystemInterface.h:
* libWebKitSystemInterfaceLeopard.a:
* libWebKitSystemInterfaceSnowLeopard.a:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67247 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index cfcae42..ebfdc5d 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,22 @@
+2010-09-10 Anders Carlsson <andersca at apple.com>
+
+ Reviewed by Mark Rowe and Darin Adler.
+
+ Set the visible name for the web process
+ https://bugs.webkit.org/show_bug.cgi?id=45564
+ <rdar://problem/8416970>
+
+ * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
+ (WebKit::processName):
+ Add a thread safe implementation of -[NSProcessInfo processName].
+
+ (WebKit::ProcessLauncher::launchProcess):
+ Pass the process name to the child process.
+
+ * WebProcess/mac/WebProcessMainMac.mm:
+ (WebKit::WebProcessMain):
+ Set the visible name.
+
2010-09-10 Adam Barth <abarth at webkit.org>
Reviewed by Eric Seidel.
diff --git a/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm b/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm
index b0c9afb..b0f61c4 100644
--- a/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm
+++ b/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm
@@ -29,10 +29,12 @@
#include "WebProcess.h"
#include "WebSystemInterface.h"
#include <crt_externs.h>
+#include <mach-o/dyld.h>
#include <mach/machine.h>
#include <runtime/InitializeThreading.h>
#include <servers/bootstrap.h>
#include <spawn.h>
+#include <sys/param.h>
#include <wtf/PassRefPtr.h>
#include <wtf/Threading.h>
#include <wtf/text/CString.h>
@@ -45,6 +47,32 @@ extern "C" kern_return_t bootstrap_register2(mach_port_t, name_t, mach_port_t, u
namespace WebKit {
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+static const char* processName()
+{
+ return [[[NSProcessInfo processInfo] processName] fileSystemRepresentation];
+}
+#else
+// -[NSProcessInfo processName] isn't thread-safe on Leopard and Snow Leopard so we have our own implementation.
+static const char* createProcessName()
+{
+ uint32_t bufferSize = MAXPATHLEN;
+ char executablePath[bufferSize];
+
+ if (_NSGetExecutablePath(executablePath, &bufferSize))
+ return "";
+
+ const char *processName = strrchr(executablePath, '/') + 1;
+ return strdup(processName);
+}
+
+static const char* processName()
+{
+ static const char* processName = createProcessName();
+ return processName;
+}
+#endif
+
void ProcessLauncher::launchProcess()
{
// Create the listening port.
@@ -61,7 +89,7 @@ void ProcessLauncher::launchProcess()
CString serviceName = String::format("com.apple.WebKit.WebProcess-%d-%p", getpid(), this).utf8();
const char* path = [webProcessAppExecutablePath fileSystemRepresentation];
- const char* args[] = { path, "-mode", "legacywebprocess", "-servicename", serviceName.data(), 0 };
+ const char* args[] = { path, "-mode", "legacywebprocess", "-servicename", serviceName.data(), "-parentprocessname", processName(), 0 };
// Register ourselves.
kern_return_t kr = bootstrap_register2(bootstrap_port, const_cast<char*>(serviceName.data()), listeningPort, 0);
diff --git a/WebKit2/WebProcess/mac/WebProcessMainMac.mm b/WebKit2/WebProcess/mac/WebProcessMainMac.mm
index dece49a..4b49921 100644
--- a/WebKit2/WebProcess/mac/WebProcessMainMac.mm
+++ b/WebKit2/WebProcess/mac/WebProcessMainMac.mm
@@ -30,6 +30,7 @@
#import "WebProcess.h"
#import "WebSystemInterface.h"
#import <WebKit2/WKView.h>
+#import <WebKitSystemInterface.h>
#import <objc/objc-auto.h>
#import <runtime/InitializeThreading.h>
#import <servers/bootstrap.h>
@@ -37,6 +38,7 @@
#import <stdio.h>
#import <sysexits.h>
#import <unistd.h>
+#import <wtf/RetainPtr.h>
#import <wtf/Threading.h>
#import <wtf/text/CString.h>
@@ -80,7 +82,6 @@ int WebProcessMain(CommandLine* commandLine)
printf("bootstrap_look_up2 result: %x", kr);
return 2;
}
-
#if !SHOW_CRASH_REPORTER
// Installs signal handlers that exit on a crash so that CrashReporter does not show up.
@@ -95,6 +96,14 @@ int WebProcessMain(CommandLine* commandLine)
WTF::initializeMainThread();
RunLoop::initializeMainRunLoop();
+ // Set the visible application name.
+ String parentProcessName = (*commandLine)["parentprocessname"];
+ if (!parentProcessName.isNull()) {
+ // FIXME: Localization!
+ NSString *applicationName = [NSString stringWithFormat:@"%@ Web Content", (NSString *)parentProcessName];
+ WKSetVisibleApplicationName((CFStringRef)applicationName);
+ }
+
// Create the connection.
WebProcess::shared().initialize(serverPort, RunLoop::main());
diff --git a/WebKitLibraries/ChangeLog b/WebKitLibraries/ChangeLog
index 3d603d9..e1e53e6 100644
--- a/WebKitLibraries/ChangeLog
+++ b/WebKitLibraries/ChangeLog
@@ -1,3 +1,14 @@
+2010-09-10 Anders Carlsson <andersca at apple.com>
+
+ WebKitSystemInterface part of:
+ Set the visible name for the web process
+ https://bugs.webkit.org/show_bug.cgi?id=45564
+ <rdar://problem/8416970>
+
+ * WebKitSystemInterface.h:
+ * libWebKitSystemInterfaceLeopard.a:
+ * libWebKitSystemInterfaceSnowLeopard.a:
+
2010-08-05 Jian Li <jianli at chromium.org>
Reviewed by David Levin.
diff --git a/WebKitLibraries/WebKitSystemInterface.h b/WebKitLibraries/WebKitSystemInterface.h
index 5f6dcdb..48e2954 100644
--- a/WebKitLibraries/WebKitSystemInterface.h
+++ b/WebKitLibraries/WebKitSystemInterface.h
@@ -205,6 +205,8 @@ void WKQTMovieDisableComponent(uint32_t[5]);
CFStringRef WKCopyFoundationCacheDirectory(void);
+void WKSetVisibleApplicationName(CFStringRef);
+
typedef enum {
WKMediaUIPartFullscreenButton = 0,
WKMediaUIPartMuteButton,
diff --git a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a
index 39ceb4a..b5de039 100644
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a differ
diff --git a/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a b/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
index 6dd8afc..1e6ec8c 100644
Binary files a/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a differ
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list