Bug 1680389 - Only call SetMultiprocessMode once in the main process. r=pbone

This was being called every time we created a ContentParent, which meant
that we'd get races with non-main-thread logging in the parent
process. This patch fixes it by only calling it once during process
startup.

The original goal was to avoid making logging noisier with process
information when e10s was not enabled, but given that e10s is the default
now, that is no longer relevant.

Differential Revision: https://phabricator.services.mozilla.com/D98935
This commit is contained in:
Andrew McCreight 2020-12-09 00:48:51 +00:00
Родитель 35ccea0325
Коммит 2bff6d8c82
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -664,6 +664,10 @@ void ContentParent::StartUp() {
return;
}
// From this point on, NS_WARNING, NS_ASSERTION, etc. should print out the
// PID along with the warning.
nsDebugImpl::SetMultiprocessMode("Parent");
// Note: This reporter measures all ContentParents.
RegisterStrongMemoryReporter(new ContentParentsMemoryReporter());
@ -2576,10 +2580,6 @@ ContentParent::ContentParent(const nsACString& aRemoteType, int32_t aJSPluginID)
mMessageManager = nsFrameMessageManager::NewProcessMessageManager(true);
// From this point on, NS_WARNING, NS_ASSERTION, etc. should print out the
// PID along with the warning.
nsDebugImpl::SetMultiprocessMode("Parent");
#if defined(XP_WIN)
if (XRE_IsParentProcess()) {
audio::AudioNotificationSender::Init();