Backed out 5 changesets (bug 944665, bug 922465, bug 930282) for b2g xpcshell crashes
authorPhil Ringnalda <philringnalda@gmail.com>
Sun, 08 Dec 2013 15:32:15 -0800
changeset 159425 06b3a7aea2c0349d4361a1499a25a7fd9f476400
parent 159424 379cddab8d6a3d5b34839d7ace3a2c5d7a5f8255
child 159446 5c7612dcd6dc406da18f98719cdb1d74b6730098
child 159450 ff66c30344abebe0aa9af2cbc551370337e4d4be
child 159461 d9a7e0906f2ac2ed92580c0804fdcdb626adf17d
child 159485 c9634bdaec6728c8fda8eb9c1a8a7e5d5e590c18
push id25793
push userphilringnalda@gmail.com
push dateSun, 08 Dec 2013 23:47:00 +0000
treeherdermozilla-central@06b3a7aea2c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs944665, 922465, 930282
milestone28.0a1
backs outc4f970dd2a4f9c68fde34527c18a3ebf91261a7f
625f5303fc688c4188897eb6fcf32c5e4a02891b
bf8e90edd15278c5c6ff5b7dfda3d5070a49744b
a21b57c782537688dbbc9ee86df1129fee1426d4
9275a2efc9e31f2cd3a9ab078cc6e7e60c496581
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 5 changesets (bug 944665, bug 922465, bug 930282) for b2g xpcshell crashes CLOSED TREE Backed out changeset c4f970dd2a4f (bug 930282) Backed out changeset 625f5303fc68 (bug 930282) Backed out changeset bf8e90edd152 (bug 922465) Backed out changeset a21b57c78253 (bug 944665) Backed out changeset 9275a2efc9e3 (bug 944665)
b2g/confvars.sh
dom/ipc/ContentChild.cpp
dom/ipc/ContentParent.cpp
dom/ipc/ContentParent.h
dom/ipc/PreallocatedProcessManager.cpp
dom/ipc/tests/mochitest.ini
dom/ipc/tests/moz.build
dom/ipc/tests/test_NuwaProcessCreation.html
netwerk/base/src/nsPACMan.cpp
xpcom/threads/BackgroundHangMonitor.cpp
--- a/b2g/confvars.sh
+++ b/b2g/confvars.sh
@@ -51,14 +51,12 @@ MOZ_EXTENSION_MANAGER=1
 MOZ_TIME_MANAGER=1
 
 MOZ_B2G_CERTDATA=1
 MOZ_PAY=1
 MOZ_TOOLKIT_SEARCH=
 MOZ_PLACES=
 MOZ_B2G=1
 
-if test "$OS_TARGET" = "Android"; then
-MOZ_NUWA_PROCESS=1
-fi
+#MOZ_NUWA_PROCESS=1
 MOZ_FOLD_LIBS=1
 
 MOZ_JSDOWNLOADS=1
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -1343,52 +1343,46 @@ OnFinishNuwaPreparation ()
 static void
 PreloadSlowThings()
 {
     // This fetches and creates all the built-in stylesheets.
     nsLayoutStylesheetCache::UserContentSheet();
 
     TabChild::PreloadSlowThings();
 
+#ifdef MOZ_NUWA_PROCESS
+    // After preload of slow things, start freezing threads.
+    if (IsNuwaProcess()) {
+        // Perform GC before freezing the Nuwa process to reduce memory usage.
+        ContentChild::GetSingleton()->RecvGarbageCollect();
+
+        MessageLoop::current()->
+                PostTask(FROM_HERE,
+                         NewRunnableFunction(OnFinishNuwaPreparation));
+    }
+#endif
 }
 
 bool
 ContentChild::RecvAppInfo(const nsCString& version, const nsCString& buildID,
                           const nsCString& name, const nsCString& UAName)
 {
     mAppInfo.version.Assign(version);
     mAppInfo.buildID.Assign(buildID);
     mAppInfo.name.Assign(name);
     mAppInfo.UAName.Assign(UAName);
-
-    if (!Preferences::GetBool("dom.ipc.processPrelaunch.enabled", false)) {
-        return true;
-    }
-
     // If we're part of the mozbrowser machinery, go ahead and start
     // preloading things.  We can only do this for mozbrowser because
     // PreloadSlowThings() may set the docshell of the first TabChild
     // inactive, and we can only safely restore it to active from
     // BrowserElementChild.js.
-    if ((mIsForApp || mIsForBrowser)
-#ifdef MOZ_NUWA_PROCESS
-        && !IsNuwaProcess()
-#endif
-       ) {
+    if ((mIsForApp || mIsForBrowser) &&
+        Preferences::GetBool("dom.ipc.processPrelaunch.enabled", false)) {
         PreloadSlowThings();
     }
-
-#ifdef MOZ_NUWA_PROCESS
-    if (IsNuwaProcess()) {
-        ContentChild::GetSingleton()->RecvGarbageCollect();
-        MessageLoop::current()->PostTask(
-            FROM_HERE, NewRunnableFunction(OnFinishNuwaPreparation));
-    }
-#endif
-
     return true;
 }
 
 bool
 ContentChild::RecvLastPrivateDocShellDestroyed()
 {
     nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
     obs->NotifyObservers(nullptr, "last-pb-context-exited", nullptr);
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -1244,23 +1244,103 @@ ContentParent::ContentParent(mozIApplica
     std::vector<std::string> extraArgs;
     if (aIsNuwaProcess) {
         extraArgs.push_back("-nuwa");
     }
     mSubprocess->LaunchAndWaitForProcessHandle(extraArgs);
 
     Open(mSubprocess->GetChannel(), mSubprocess->GetOwnedChildProcessHandle());
 
-    InitInternal(aInitialPriority,
-                 true, /* Setup off-main thread compositing */
-                 true  /* Send registered chrome */);
+    // Set the subprocess's priority.  We do this early on because we're likely
+    // /lowering/ the process's CPU and memory priority, which it has inherited
+    // from this process.
+    //
+    // This call can cause us to send IPC messages to the child process, so it
+    // must come after the Open() call above.
+    ProcessPriorityManager::SetProcessPriority(this, aInitialPriority);
+
+    // NB: internally, this will send an IPC message to the child
+    // process to get it to create the CompositorChild.  This
+    // message goes through the regular IPC queue for this
+    // channel, so delivery will happen-before any other messages
+    // we send.  The CompositorChild must be created before any
+    // PBrowsers are created, because they rely on the Compositor
+    // already being around.  (Creation is async, so can't happen
+    // on demand.)
+    bool useOffMainThreadCompositing = !!CompositorParent::CompositorLoop();
+    if (useOffMainThreadCompositing) {
+        DebugOnly<bool> opened = PCompositor::Open(this);
+        MOZ_ASSERT(opened);
+
+        if (Preferences::GetBool("layers.async-video.enabled",false)) {
+            opened = PImageBridge::Open(this);
+            MOZ_ASSERT(opened);
+        }
+    }
+
+    nsCOMPtr<nsIChromeRegistry> registrySvc = nsChromeRegistry::GetService();
+    nsChromeRegistryChrome* chromeRegistry =
+        static_cast<nsChromeRegistryChrome*>(registrySvc.get());
+    chromeRegistry->SendRegisteredChrome(this);
+    mMessageManager = nsFrameMessageManager::NewProcessMessageManager(this);
+
+    if (gAppData) {
+        nsCString version(gAppData->version);
+        nsCString buildID(gAppData->buildID);
+        nsCString name(gAppData->name);
+        nsCString UAName(gAppData->UAName);
+
+        // Sending all information to content process.
+        unused << SendAppInfo(version, buildID, name, UAName);
+    }
+
+    nsStyleSheetService *sheetService = nsStyleSheetService::GetInstance();
+    if (sheetService) {
+        // This looks like a lot of work, but in a normal browser session we just
+        // send two loads.
+
+        nsCOMArray<nsIStyleSheet>& agentSheets = *sheetService->AgentStyleSheets();
+        for (uint32_t i = 0; i < agentSheets.Length(); i++) {
+            URIParams uri;
+            SerializeURI(agentSheets[i]->GetSheetURI(), uri);
+            unused << SendLoadAndRegisterSheet(uri, nsIStyleSheetService::AGENT_SHEET);
+        }
+
+        nsCOMArray<nsIStyleSheet>& userSheets = *sheetService->UserStyleSheets();
+        for (uint32_t i = 0; i < userSheets.Length(); i++) {
+            URIParams uri;
+            SerializeURI(userSheets[i]->GetSheetURI(), uri);
+            unused << SendLoadAndRegisterSheet(uri, nsIStyleSheetService::USER_SHEET);
+        }
+
+        nsCOMArray<nsIStyleSheet>& authorSheets = *sheetService->AuthorStyleSheets();
+        for (uint32_t i = 0; i < authorSheets.Length(); i++) {
+            URIParams uri;
+            SerializeURI(authorSheets[i]->GetSheetURI(), uri);
+            unused << SendLoadAndRegisterSheet(uri, nsIStyleSheetService::AUTHOR_SHEET);
+        }
+    }
+
+#ifdef MOZ_CONTENT_SANDBOX
+    // Bug 921817.  We enable the sandbox in RecvSetProcessPrivileges,
+    // which is where a preallocated process drops unnecessary privileges,
+    // but a non-preallocated process will already have changed its
+    // uid/gid/etc immediately after forking.  Thus, we send this message,
+    // which is otherwise a no-op, to sandbox it at an appropriate point
+    // during startup.
+    if (aOSPrivileges != base::PRIVILEGES_INHERIT) {
+        if (!SendSetProcessPrivileges(base::PRIVILEGES_INHERIT)) {
+            KillHard();
+        }
+    }
+#endif
 }
 
 #ifdef MOZ_NUWA_PROCESS
-static const mozilla::ipc::FileDescriptor*
+static const FileDescriptor*
 FindFdProtocolFdMapping(const nsTArray<ProtocolFdMapping>& aFds,
                         ProtocolId aProtoId)
 {
     for (unsigned int i = 0; i < aFds.Length(); i++) {
         if (aFds[i].protocolId() == aProtoId) {
             return &aFds[i].fd();
         }
     }
@@ -1316,19 +1396,18 @@ ContentParent::ContentParent(ContentPare
     // memory priority, which it has inherited from this process.
     ProcessPriority priority;
     if (IsPreallocated()) {
         priority = PROCESS_PRIORITY_BACKGROUND;
     } else {
         priority = PROCESS_PRIORITY_FOREGROUND;
     }
 
-    InitInternal(priority,
-                 false, /* Setup Off-main thread compositing */
-                 false  /* Send registered chrome */);
+    ProcessPriorityManager::SetProcessPriority(this, priority);
+    mMessageManager = nsFrameMessageManager::NewProcessMessageManager(this);
 }
 #endif  // MOZ_NUWA_PROCESS
 
 ContentParent::~ContentParent()
 {
     if (mForceKillTask) {
         mForceKillTask->Cancel();
     }
@@ -1348,111 +1427,16 @@ ContentParent::~ContentParent()
         // nullptr.  But it could be that we created another ContentParent for
         // this app after we did this->ActorDestroy(), so the right check is
         // that sAppContentParents->Get(mAppManifestURL) != this.
         MOZ_ASSERT(!sAppContentParents ||
                    sAppContentParents->Get(mAppManifestURL) != this);
     }
 }
 
-void
-ContentParent::InitInternal(ProcessPriority aInitialPriority,
-                            bool aSetupOffMainThreadCompositing,
-                            bool aSendRegisteredChrome)
-{
-    // Set the subprocess's priority.  We do this early on because we're likely
-    // /lowering/ the process's CPU and memory priority, which it has inherited
-    // from this process.
-    //
-    // This call can cause us to send IPC messages to the child process, so it
-    // must come after the Open() call above.
-    ProcessPriorityManager::SetProcessPriority(this, aInitialPriority);
-
-    if (aSetupOffMainThreadCompositing) {
-        // NB: internally, this will send an IPC message to the child
-        // process to get it to create the CompositorChild.  This
-        // message goes through the regular IPC queue for this
-        // channel, so delivery will happen-before any other messages
-        // we send.  The CompositorChild must be created before any
-        // PBrowsers are created, because they rely on the Compositor
-        // already being around.  (Creation is async, so can't happen
-        // on demand.)
-        bool useOffMainThreadCompositing = !!CompositorParent::CompositorLoop();
-        if (useOffMainThreadCompositing) {
-            DebugOnly<bool> opened = PCompositor::Open(this);
-            MOZ_ASSERT(opened);
-
-            if (Preferences::GetBool("layers.async-video.enabled",false)) {
-                opened = PImageBridge::Open(this);
-                MOZ_ASSERT(opened);
-            }
-        }
-    }
-
-    if (aSendRegisteredChrome) {
-        nsCOMPtr<nsIChromeRegistry> registrySvc = nsChromeRegistry::GetService();
-        nsChromeRegistryChrome* chromeRegistry =
-            static_cast<nsChromeRegistryChrome*>(registrySvc.get());
-        chromeRegistry->SendRegisteredChrome(this);
-    }
-
-    mMessageManager = nsFrameMessageManager::NewProcessMessageManager(this);
-
-    if (gAppData) {
-        nsCString version(gAppData->version);
-        nsCString buildID(gAppData->buildID);
-        nsCString name(gAppData->name);
-        nsCString UAName(gAppData->UAName);
-
-        // Sending all information to content process.
-        unused << SendAppInfo(version, buildID, name, UAName);
-    }
-
-    nsStyleSheetService *sheetService = nsStyleSheetService::GetInstance();
-    if (sheetService) {
-        // This looks like a lot of work, but in a normal browser session we just
-        // send two loads.
-
-        nsCOMArray<nsIStyleSheet>& agentSheets = *sheetService->AgentStyleSheets();
-        for (uint32_t i = 0; i < agentSheets.Length(); i++) {
-            URIParams uri;
-            SerializeURI(agentSheets[i]->GetSheetURI(), uri);
-            unused << SendLoadAndRegisterSheet(uri, nsIStyleSheetService::AGENT_SHEET);
-        }
-
-        nsCOMArray<nsIStyleSheet>& userSheets = *sheetService->UserStyleSheets();
-        for (uint32_t i = 0; i < userSheets.Length(); i++) {
-            URIParams uri;
-            SerializeURI(userSheets[i]->GetSheetURI(), uri);
-            unused << SendLoadAndRegisterSheet(uri, nsIStyleSheetService::USER_SHEET);
-        }
-
-        nsCOMArray<nsIStyleSheet>& authorSheets = *sheetService->AuthorStyleSheets();
-        for (uint32_t i = 0; i < authorSheets.Length(); i++) {
-            URIParams uri;
-            SerializeURI(authorSheets[i]->GetSheetURI(), uri);
-            unused << SendLoadAndRegisterSheet(uri, nsIStyleSheetService::AUTHOR_SHEET);
-        }
-    }
-
-#ifdef MOZ_CONTENT_SANDBOX
-    // Bug 921817.  We enable the sandbox in RecvSetProcessPrivileges,
-    // which is where a preallocated process drops unnecessary privileges,
-    // but a non-preallocated process will already have changed its
-    // uid/gid/etc immediately after forking.  Thus, we send this message,
-    // which is otherwise a no-op, to sandbox it at an appropriate point
-    // during startup.
-    if (mOSPrivileges != base::PRIVILEGES_INHERIT) {
-        if (!SendSetProcessPrivileges(base::PRIVILEGES_INHERIT)) {
-            KillHard();
-        }
-    }
-#endif
-}
-
 bool
 ContentParent::IsAlive()
 {
     return mIsAlive;
 }
 
 bool
 ContentParent::IsForApp()
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -260,21 +260,16 @@ private:
                   base::ProcessHandle aPid,
                   const nsTArray<ProtocolFdMapping>& aFds,
                   ChildPrivileges aOSPrivileges = base::PRIVILEGES_DEFAULT);
 #endif
 
     // The common initialization for the constructors.
     void InitializeMembers();
 
-    // The common initialization logic shared by all constuctors.
-    void InitInternal(ProcessPriority aPriority,
-                      bool aSetupOffMainThreadCompositing,
-                      bool aSendRegisteredChrome);
-
     virtual ~ContentParent();
 
     void Init();
 
     // If the frame element indicates that the child process is "critical" and
     // has a pending system message, this function acquires the CPU wake lock on
     // behalf of the child.  We'll release the lock when the system message is
     // handled or after a timeout, whichever comes first.
--- a/dom/ipc/PreallocatedProcessManager.cpp
+++ b/dom/ipc/PreallocatedProcessManager.cpp
@@ -276,25 +276,16 @@ PreallocatedProcessManagerImpl::GetSpare
 /**
  * Publish a ContentParent to spare process list.
  */
 void
 PreallocatedProcessManagerImpl::PublishSpareProcess(ContentParent* aContent)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  if (Preferences::GetBool("dom.ipc.processPriorityManager.testMode")) {
-    AutoJSContext cx;
-    nsCOMPtr<nsIMessageBroadcaster> ppmm =
-      do_GetService("@mozilla.org/parentprocessmessagemanager;1");
-    nsresult rv = ppmm->BroadcastAsyncMessage(
-      NS_LITERAL_STRING("TEST-ONLY:nuwa-add-new-process"),
-      JSVAL_NULL, JSVAL_NULL, cx, 1);
-  }
-
   if (!mNuwaForkWaitTasks.IsEmpty()) {
     mNuwaForkWaitTasks.ElementAt(0)->Cancel();
     mNuwaForkWaitTasks.RemoveElementAt(0);
   }
 
   mSpareProcesses.AppendElement(aContent);
 }
 
@@ -316,24 +307,16 @@ PreallocatedProcessManagerImpl::MaybeFor
 
 void
 PreallocatedProcessManagerImpl::OnNuwaReady()
 {
   NS_ASSERTION(!mIsNuwaReady, "Multiple Nuwa processes created!");
   ProcessPriorityManager::SetProcessPriority(mPreallocatedAppProcess,
                                              hal::PROCESS_PRIORITY_FOREGROUND);
   mIsNuwaReady = true;
-  if (Preferences::GetBool("dom.ipc.processPriorityManager.testMode")) {
-    AutoJSContext cx;
-    nsCOMPtr<nsIMessageBroadcaster> ppmm =
-      do_GetService("@mozilla.org/parentprocessmessagemanager;1");
-    nsresult rv = ppmm->BroadcastAsyncMessage(
-      NS_LITERAL_STRING("TEST-ONLY:nuwa-ready"),
-      JSVAL_NULL, JSVAL_NULL, cx, 1);
-  }
   NuwaFork();
 }
 
 void
 PreallocatedProcessManagerImpl::OnNuwaForkTimeout()
 {
   if (!mNuwaForkWaitTasks.IsEmpty()) {
     mNuwaForkWaitTasks.RemoveElementAt(0);
deleted file mode 100644
--- a/dom/ipc/tests/mochitest.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-[test_NuwaProcessCreation.html]
-run-if = toolkit == 'gonk'
--- a/dom/ipc/tests/moz.build
+++ b/dom/ipc/tests/moz.build
@@ -1,9 +1,8 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 MOCHITEST_CHROME_MANIFESTS += ['chrome.ini']
-MOCHITEST_MANIFESTS += ['mochitest.ini']
 
deleted file mode 100644
--- a/dom/ipc/tests/test_NuwaProcessCreation.html
+++ /dev/null
@@ -1,99 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-Test if Nuwa process created successfully.
--->
-<head>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="application/javascript;version=1.7">
-"use strict";
-
-SimpleTest.waitForExplicitFinish();
-
-function TestLoader() {}
-
-TestLoader.prototype = {
-  _waitingTask: 0,
-  onTestReady: null,
-  unlockTestReady: function() {
-    this._waitingTask--;
-    this._maybeLoadTest();
-  },
-  lockTestReady: function() {
-    this._waitingTask++;
-  },
-  _maybeLoadTest: function() {
-    if (this._waitingTask == 0) {
-      this.onTestReady();
-    }
-  }
-}
-
-var testLoader = new TestLoader();
-testLoader.lockTestReady();
-window.addEventListener('load', function() {
-  testLoader.unlockTestReady();
-});
-
-function setPref(pref, value) {
-  testLoader.lockTestReady();
-  if (value !== undefined && value !== null) {
-    SpecialPowers.pushPrefEnv({'set': [[pref, value]]}, function() { testLoader.unlockTestReady(); });
-  } else {
-    SpecialPowers.pushPrefEnv({'clear': [[pref]]}, function() { testLoader.unlockTestReady(); });
-  }
-}
-
-setPref('dom.ipc.processPriorityManager.testMode', true);
-setPref('dom.ipc.processPriorityManager.enabled', true);
-setPref('dom.ipc.processPriorityManager.backgroundLRUPoolLevels', 2);
-
-function runTest()
-{
-  // Shutdown preallocated process.
-  SpecialPowers.setBoolPref('dom.ipc.processPrelaunch.enabled', false);
-  let cpmm = SpecialPowers.Cc["@mozilla.org/childprocessmessagemanager;1"]
-                          .getService(SpecialPowers.Ci.nsISyncMessageSender);
-  let seenNuwaReady = false;
-  let msgHandler = {
-    receiveMessage: function receiveMessage(msg) {
-      msg = SpecialPowers.wrap(msg);
-      if (msg.name == 'TEST-ONLY:nuwa-ready') {
-        ok(true, "Got nuwa-ready");
-        is(seenNuwaReady, false, "Already received nuwa ready");
-        seenNuwaReady = true;
-      } else if (msg.name == 'TEST-ONLY:nuwa-add-new-process') {
-        ok(true, "Got nuwa-add-new-process");
-        is(seenNuwaReady, true, "Receive nuwa-add-new-process before nuwa-ready");
-        testEnd();
-      }
-    }
-  };
-  let timeout = setTimeout(function() {
-    ok(false, "Nuwa process is not launched");
-    testEnd();
-  }, 60000);
-
-  function testEnd() {
-    cpmm.removeMessageListener("TEST-ONLY:nuwa-ready", msgHandler);
-    cpmm.removeMessageListener("TEST-ONLY:nuwa-add-new-process", msgHandler);
-    clearTimeout(timeout);
-    SimpleTest.finish();
-  }
-
-  cpmm.addMessageListener("TEST-ONLY:nuwa-ready", msgHandler);
-  cpmm.addMessageListener("TEST-ONLY:nuwa-add-new-process", msgHandler);
-
-
-  // Setting this pref to true should cause us to prelaunch a process.
-  SpecialPowers.setBoolPref('dom.ipc.processPrelaunch.enabled', true);
-}
-
-testLoader.onTestReady = runTest;
-</script>
-</body>
-</html>
--- a/netwerk/base/src/nsPACMan.cpp
+++ b/netwerk/base/src/nsPACMan.cpp
@@ -9,19 +9,16 @@
 #include "nsIAuthPrompt.h"
 #include "nsIPromptFactory.h"
 #include "nsIHttpChannel.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsNetUtil.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
 #include "nsISystemProxySettings.h"
-#ifdef MOZ_NUWA_PROCESS
-#include "ipc/Nuwa.h"
-#endif
 
 //-----------------------------------------------------------------------------
 using namespace mozilla;
 using namespace mozilla::net;
 
 #if defined(PR_LOGGING)
 #endif
 #undef LOG
@@ -672,23 +669,16 @@ nsPACMan::AsyncOnChannelRedirect(nsIChan
   return NS_OK;
 }
 
 void
 nsPACMan::NamePACThread()
 {
   NS_ABORT_IF_FALSE(!NS_IsMainThread(), "wrong thread");
   PR_SetCurrentThreadName("Proxy Resolution");
-#ifdef MOZ_NUWA_PROCESS
-  if (IsNuwaProcess()) {
-    NS_ASSERTION(NuwaMarkCurrentThread != nullptr,
-                 "NuwaMarkCurrentThread is undefined!");
-    NuwaMarkCurrentThread(nullptr, nullptr);
-  }
-#endif
 }
 
 nsresult
 nsPACMan::Init(nsISystemProxySettings *systemProxySettings)
 {
   mSystemProxySettings = systemProxySettings;
 
   nsresult rv = NS_NewThread(getter_AddRefs(mPACThread), nullptr);
--- a/xpcom/threads/BackgroundHangMonitor.cpp
+++ b/xpcom/threads/BackgroundHangMonitor.cpp
@@ -6,19 +6,16 @@
 #include "mozilla/BackgroundHangMonitor.h"
 #include "mozilla/LinkedList.h"
 #include "mozilla/Monitor.h"
 #include "mozilla/Move.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/ThreadHangStats.h"
 #include "mozilla/ThreadLocal.h"
-#ifdef MOZ_NUWA_PROCESS
-#include "ipc/Nuwa.h"
-#endif
 
 #include "prinrval.h"
 #include "prthread.h"
 #include "ThreadStackHelper.h"
 
 #include <algorithm>
 
 namespace mozilla {
@@ -29,25 +26,16 @@ namespace mozilla {
  */
 class BackgroundHangManager : public AtomicRefCounted<BackgroundHangManager>
 {
 private:
   // Background hang monitor thread function
   static void MonitorThread(void* aData)
   {
     PR_SetCurrentThreadName("BgHangManager");
-
-#ifdef MOZ_NUWA_PROCESS
-    if (IsNuwaProcess()) {
-      NS_ASSERTION(NuwaMarkCurrentThread != nullptr,
-                   "NuwaMarkCurrentThread is undefined!");
-      NuwaMarkCurrentThread(nullptr, nullptr);
-    }
-#endif
-
     /* We do not hold a reference to BackgroundHangManager here
        because the monitor thread only exists as long as the
        BackgroundHangManager instance exists. We stop the monitor
        thread in the BackgroundHangManager destructor, and we can
        only get to the destructor if we don't hold a reference here. */
     static_cast<BackgroundHangManager*>(aData)->RunMonitorThread();
   }