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 290500 9061abb46bc777c543cb2ef4ec3c411866d25172
parent 290499 0bdd199c0911e5f60a84af9bb869832aa2eaf023
child 290501 b5d975e3f9824811d93b6eef54279a0875bf3efe
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1259737
milestone48.0a1
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)