mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1011225: Improve e10s process naming on OS X. Patch started by Benoit Girard, completed by Josh Aas. r=njn,benwa
This commit is contained in:
parent
0735cf9d8c
commit
bc9f156182
@ -592,6 +592,7 @@ ContentChild::Init(MessageLoop* aIOLoop,
|
||||
void
|
||||
ContentChild::InitProcessAttributes()
|
||||
{
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
#ifdef MOZ_NUWA_PROCESS
|
||||
if (IsNuwaProcess()) {
|
||||
SetProcessName(NS_LITERAL_STRING("(Nuwa)"), false);
|
||||
@ -603,7 +604,9 @@ ContentChild::InitProcessAttributes()
|
||||
} else {
|
||||
SetProcessName(NS_LITERAL_STRING("Browser"), false);
|
||||
}
|
||||
|
||||
#else
|
||||
SetProcessName(NS_LITERAL_STRING("Web Content"), true);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -184,7 +184,10 @@ PluginModuleChild::Init(const std::string& aPluginFilename,
|
||||
AddQuirk(QUIRK_FLASH_EXPOSE_COORD_TRANSLATION);
|
||||
}
|
||||
#else // defined(OS_MACOSX)
|
||||
mozilla::plugins::PluginUtilsOSX::SetProcessName(info.fName);
|
||||
const char* namePrefix = "Plugin Content";
|
||||
char nameBuffer[80];
|
||||
snprintf(nameBuffer, sizeof(nameBuffer), "%s (%s)", namePrefix, info.fName);
|
||||
mozilla::plugins::PluginUtilsOSX::SetProcessName(nameBuffer);
|
||||
#endif
|
||||
|
||||
pluginFile.FreePluginInfo(info);
|
||||
|
@ -277,7 +277,7 @@ bool mozilla::plugins::PluginUtilsOSX::SetProcessName(const char* aProcessName)
|
||||
|
||||
char formattedName[1024];
|
||||
snprintf(formattedName, sizeof(formattedName),
|
||||
"%s (%s)", [currentName UTF8String], aProcessName);
|
||||
"%s %s", [currentName UTF8String], aProcessName);
|
||||
|
||||
aProcessName = formattedName;
|
||||
|
||||
|
@ -4,4 +4,4 @@
|
||||
|
||||
/* Localized versions of Info.plist keys */
|
||||
|
||||
CFBundleName = "%APP_NAME% Plugin Process";
|
||||
CFBundleName = "%APP_NAME%";
|
||||
|
20
ipc/glue/ProcessUtils_mac.mm
Normal file
20
ipc/glue/ProcessUtils_mac.mm
Normal file
@ -0,0 +1,20 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "ProcessUtils.h"
|
||||
|
||||
#include "nsString.h"
|
||||
|
||||
#include "mozilla/plugins/PluginUtilsOSX.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace ipc {
|
||||
|
||||
void SetThisProcessName(const char *aName)
|
||||
{
|
||||
mozilla::plugins::PluginUtilsOSX::SetProcessName(aName);
|
||||
}
|
||||
|
||||
} // namespace ipc
|
||||
} // namespace mozilla
|
@ -85,6 +85,10 @@ elif CONFIG['OS_ARCH'] in ('DragonFly', 'FreeBSD', 'NetBSD', 'OpenBSD'):
|
||||
UNIFIED_SOURCES += [
|
||||
'ProcessUtils_bsd.cpp'
|
||||
]
|
||||
elif CONFIG['OS_ARCH'] in ('Darwin'):
|
||||
UNIFIED_SOURCES += [
|
||||
'ProcessUtils_mac.mm'
|
||||
]
|
||||
else:
|
||||
UNIFIED_SOURCES += [
|
||||
'ProcessUtils_none.cpp',
|
||||
|
@ -126,7 +126,10 @@
|
||||
|
||||
// Note: Match "vsize" but not "vsize-max-contiguous".
|
||||
let vsizes = actual.match(/vsize[^-]/g);
|
||||
let endOfBrowsers = actual.match(/End of Browser/g);
|
||||
let endOfBrowsers = actual.match(/End of Browser/g);
|
||||
if (endOfBrowsers == null) {
|
||||
endOfBrowsers = actual.match(/End of Web Content/g);
|
||||
}
|
||||
let m2 = (vsizes.length == 4 && endOfBrowsers.length == 3);
|
||||
ok(m2, "three child processes present in loaded data");
|
||||
good = good && !!m2;
|
||||
|
@ -85,8 +85,8 @@
|
||||
if (processes[i] == "") {
|
||||
numEmptyProcesses++;
|
||||
} else {
|
||||
ok(processes[i].startsWith("Browser ("),
|
||||
"correct non-empty process name prefix");
|
||||
ok(processes[i].startsWith("Browser (") || processes[i].startsWith("Web Content ("),
|
||||
"correct non-empty process name prefix: " + processes[i]);
|
||||
numNonEmptyProcesses++;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user