[webkit-reviews] review granted: [Bug 45564] Set the visible name for the web process : [Attachment 67232] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 10 14:29:43 PDT 2010


Mark Rowe (bdash) <mrowe at apple.com> has granted Anders Carlsson
<andersca at apple.com>'s request for review:
Bug 45564: Set the visible name for the web process
https://bugs.webkit.org/show_bug.cgi?id=45564

Attachment 67232: Patch
https://bugs.webkit.org/attachment.cgi?id=67232&action=review

------- Additional Comments from Mark Rowe (bdash) <mrowe at apple.com>
> @@ -45,6 +47,23 @@ extern "C" kern_return_t bootstrap_register2(mach_port_t,
name_t, mach_port_t, u
>  
>  namespace WebKit {
>  
> +// -[NSProcessInfo processName] isn't thread-safe so we have our own
implementation.

We should do this conditionally and use -[NSProcessInfo processName] on
platforms where it is thread-safe.

> +static const char* processName() {

Misplaced {.

> +    static CString* processName;
> +    if (!processName) {
> +	   uint32_t bufferSize = MAXPATHLEN;
> +	   char executablePath[bufferSize];
> +
> +	   if (_NSGetExecutablePath(executablePath, &bufferSize))
> +	       return “”;

If _NSGetExecutablePath fails we’ll do this work every time the function is
called.  Is that expected?  Does _NSGetExecutablePath fail temporarily and then
later give us valid results?

> @@ -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);
> +    }

It would’ve been nicer if WKSetVisibleApplicationName took an NSString*.

r=me


More information about the webkit-reviews mailing list