Bug 1259737 - Make sure BackgroundImpl.cpp's mBoundThread is not used in release builds. r=froydnj
authorJonathan Watt <jwatt@jwatt.org>
Mon, 14 Mar 2016 21:21:42 +0000
changeset 290401 9061abb46bc777c543cb2ef4ec3c411866d25172
parent 290400 0bdd199c0911e5f60a84af9bb869832aa2eaf023
child 290402 b5d975e3f9824811d93b6eef54279a0875bf3efe
push id74240
push userjwatt@jwatt.org
push dateFri, 25 Mar 2016 21:22:42 +0000
treeherdermozilla-inbound@9061abb46bc7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1259737
milestone48.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 1259737 - Make sure BackgroundImpl.cpp's mBoundThread is not used in release builds. r=froydnj
ipc/glue/BackgroundImpl.cpp
--- a/ipc/glue/BackgroundImpl.cpp
+++ b/ipc/glue/BackgroundImpl.cpp
@@ -336,21 +336,17 @@ class ChildImpl final : public Backgroun
   // This is only modified on the main thread. It is a FIFO queue for actors
   // that are in the process of construction.
   static StaticAutoPtr<nsTArray<nsCOMPtr<nsIEventTarget>>> sPendingTargets;
 
   // This is only modified on the main thread. It prevents us from trying to
   // create the background thread after application shutdown has started.
   static bool sShutdownHasStarted;
 
-#ifdef RELEASE_BUILD
-#ifdef DEBUG
-  nsIThread* mBoundThread;
-#endif
-#else
+#if defined(DEBUG) || !defined(RELEASE_BUILD)
   nsIThread* mBoundThread;
 #endif
 
 #ifdef DEBUG
   bool mActorDestroyed;
 #endif
 
 public:
@@ -377,17 +373,19 @@ public:
 
   void
   AssertActorDestroyed()
   {
     MOZ_ASSERT(mActorDestroyed, "ChildImpl::ActorDestroy not called in time");
   }
 
   ChildImpl()
+#if defined(DEBUG) || !defined(RELEASE_BUILD)
   : mBoundThread(nullptr)
+#endif
 #ifdef DEBUG
   , mActorDestroyed(false)
 #endif
   {
     AssertIsOnMainThread();
   }
 
   NS_INLINE_DECL_REFCOUNTING(ChildImpl)