Commit 2bff6d8c authored by Andrew McCreight's avatar Andrew McCreight
Browse files

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
parent 35ccea03
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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();