Bug 1204837, Part 1: Make ClosingService thread Nuwa-friedly. r=khuey
authorCervantes Yu <cyu@mozilla.com>
Wed, 16 Sep 2015 18:55:44 +0800
changeset 265639 90c9af6a9708445d2e96746c34ab419376e9bf69
parent 265638 cb44ba24be1220be4d69ffc373b3dfc51f080309
child 265640 2d4f2af678ee9149baee5f3542950d8f38f66994
push id66003
push usercbook@mozilla.com
push dateFri, 02 Oct 2015 11:37:40 +0000
treeherdermozilla-inbound@3fd732d24f46 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs1204837
milestone44.0a1
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
Bug 1204837, Part 1: Make ClosingService thread Nuwa-friedly. r=khuey
netwerk/base/ClosingService.cpp
--- a/netwerk/base/ClosingService.cpp
+++ b/netwerk/base/ClosingService.cpp
@@ -1,16 +1,19 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set sw=2 ts=8 et tw=80 : */
 /* 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 "ClosingService.h"
 #include "nsIOService.h"
+#ifdef MOZ_NUWA_PROCESS
+#include "ipc/Nuwa.h"
+#endif
 
 class ClosingLayerSecret
 {
 public:
   explicit ClosingLayerSecret(mozilla::net::ClosingService *aClosingService)
     : mClosingService(aClosingService)
   {
   }
@@ -195,16 +198,23 @@ ClosingService::ShutdownInternal()
     PR_JoinThread(mThread);
     mThread = nullptr;
   }
 }
 
 void
 ClosingService::ThreadFunc()
 {
+  PR_SetCurrentThreadName("Closing Service");
+#ifdef MOZ_NUWA_PROCESS
+  if (IsNuwaProcess()) {
+    NuwaMarkCurrentThread(nullptr, nullptr);
+  }
+#endif
+
   for (;;) {
     PRFileDesc *fd;
     {
       mozilla::MonitorAutoLock mon(mMonitor);
       while (!mShutdown && (mQueue.Length() == 0)) {
         mon.Wait();
       }