Bug 1266595: Followup to fix IPDL tests. r=billm
authorKyle Huey <khuey@kylehuey.com>
Tue, 03 May 2016 22:36:50 -0700
changeset 296097 dd6d02a7cd016d03f4bc510ad8179fb101630fcf
parent 296096 cf209d9bc29c994450d18e0a025ff3838d4b238e
child 296098 2b2f43e1bf595d002a0f9521ce6edfa2743dd4aa
push id30233
push userryanvm@gmail.com
push dateThu, 05 May 2016 18:57:26 +0000
treeherdermozilla-central@0177462aac74 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1266595
milestone49.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 1266595: Followup to fix IPDL tests. r=billm
ipc/ipdl/test/cxx/IPDLUnitTests.h
ipc/ipdl/test/cxx/IPDLUnitTests.template.cpp
ipc/ipdl/test/cxx/TestActorPunning.cpp
ipc/ipdl/test/cxx/TestBridgeMain.cpp
ipc/ipdl/test/cxx/TestCancel.cpp
ipc/ipdl/test/cxx/TestCrashCleanup.cpp
ipc/ipdl/test/cxx/TestDemon.cpp
ipc/ipdl/test/cxx/TestEndpointBridgeMain.cpp
ipc/ipdl/test/cxx/TestEndpointOpens.cpp
ipc/ipdl/test/cxx/TestHangs.cpp
ipc/ipdl/test/cxx/TestInterruptErrorCleanup.cpp
ipc/ipdl/test/cxx/TestInterruptRaces.cpp
ipc/ipdl/test/cxx/TestInterruptShutdownRace.cpp
ipc/ipdl/test/cxx/TestNestedLoops.cpp
ipc/ipdl/test/cxx/TestOpens.cpp
ipc/ipdl/test/cxx/TestRaceDeadlock.cpp
ipc/ipdl/test/cxx/TestRaceDeferral.cpp
ipc/ipdl/test/cxx/TestStackHooks.cpp
ipc/ipdl/test/cxx/TestSyncHang.cpp
ipc/ipdl/test/cxx/TestUrgentHangs.cpp
--- a/ipc/ipdl/test/cxx/IPDLUnitTests.h
+++ b/ipc/ipdl/test/cxx/IPDLUnitTests.h
@@ -24,17 +24,17 @@
 #define MOZ_IPDL_TESTINFO_LABEL "TEST-INFO"
 
 
 namespace mozilla {
 namespace _ipdltest {
 
 //-----------------------------------------------------------------------------
 // both processes
-const char* const IPDLUnitTestName();
+const char* IPDLUnitTestName();
 
 // NB: these are named like the similar functions in
 // xpcom/test/TestHarness.h.  The names should nominally be kept in
 // sync.
 
 inline void fail(const char* fmt, ...)
 {
   va_list ap;
--- a/ipc/ipdl/test/cxx/IPDLUnitTests.template.cpp
+++ b/ipc/ipdl/test/cxx/IPDLUnitTests.template.cpp
@@ -42,17 +42,17 @@ bool gChildDone;
 void
 DeleteChildActor();
 
 //-----------------------------------------------------------------------------
 // data/functions accessed by both parent and child processes
 
 char* gIPDLUnitTestName = nullptr;
 
-const char* const
+const char*
 IPDLUnitTestName()
 {
     if (!gIPDLUnitTestName) {
 #if defined(OS_WIN)
         vector<wstring> args =
             CommandLine::ForCurrentProcess()->GetLooseValues();
         gIPDLUnitTestName = ::strdup(WideToUTF8(args[0]).c_str());
 #elif defined(OS_POSIX)
@@ -92,17 +92,17 @@ IPDLUnitTestFromString(const char* const
 //===== TEMPLATED =====
 ${STRING_TO_ENUMS}
 //-----------------------------------------------------------------------------
     else
         return static_cast<IPDLUnitTestType>(0);
 }
 
 
-const char* const
+const char*
 IPDLUnitTestToString(IPDLUnitTestType aTest)
 {
     switch (aTest) {
 //-----------------------------------------------------------------------------
 //===== TEMPLATED =====
 ${ENUM_TO_STRINGS}
 //-----------------------------------------------------------------------------
 
@@ -268,25 +268,24 @@ QuitXPCOM()
   appShell->Exit();
 }
 
 void
 DeleteSubprocess(MessageLoop* uiLoop)
 {
   // pong to QuitXPCOM
   delete gSubprocess;
-  uiLoop->PostTask(FROM_HERE, NewRunnableFunction(QuitXPCOM));
+  uiLoop->PostTask(NewRunnableFunction(QuitXPCOM));
 }
 
 void
 DeferredParentShutdown()
 {
     // ping to DeleteSubprocess
     XRE_GetIOMessageLoop()->PostTask(
-        FROM_HERE,
         NewRunnableFunction(DeleteSubprocess, MessageLoop::current()));
 }
 
 void 
 TryThreadedShutdown()
 {
     // Stop if either: 
     // - the child has not finished, 
@@ -311,41 +310,41 @@ ChildCompleted()
 }
 
 void
 QuitParent()
 {
     if (gChildThread) {
         gParentDone = true;
         MessageLoop::current()->PostTask(
-            FROM_HERE, NewRunnableFunction(TryThreadedShutdown));
+            NewRunnableFunction(TryThreadedShutdown));
     } else {
         // defer "real" shutdown to avoid *Channel::Close() racing with the
         // deletion of the subprocess
         MessageLoop::current()->PostTask(
-            FROM_HERE, NewRunnableFunction(DeferredParentShutdown));
+            NewRunnableFunction(DeferredParentShutdown));
     }
 }
 
 static void
 ChildDie()
 {
     DeleteChildActor();
     XRE_ShutdownChildProcess();
 }
 
 void
 QuitChild()
 {
     if (gChildThread) { // Threaded-mode test
         gParentMessageLoop->PostTask(
-            FROM_HERE, NewRunnableFunction(ChildCompleted));
+            NewRunnableFunction(ChildCompleted));
     } else { // Process-mode test
         MessageLoop::current()->PostTask(
-            FROM_HERE, NewRunnableFunction(ChildDie));
+            NewRunnableFunction(ChildDie));
     }
 }
 
 } // namespace _ipdltest
 } // namespace mozilla
 
 
 //-----------------------------------------------------------------------------
--- a/ipc/ipdl/test/cxx/TestActorPunning.cpp
+++ b/ipc/ipdl/test/cxx/TestActorPunning.cpp
@@ -1,11 +1,12 @@
 #include "TestActorPunning.h"
 
 #include "IPDLUnitTests.h"      // fail etc.
+#include "mozilla/unused.h"
 
 namespace mozilla {
 namespace _ipdltest {
 
 //-----------------------------------------------------------------------------
 // parent
 
 void
@@ -118,14 +119,14 @@ ParamTraits<Bad>::Write(Message* aMsg, c
     ah->mId = -2;
 }
 
 /*static*/ bool
 ParamTraits<Bad>::Read(const Message* aMsg, void** aIter, paramType* aResult)
 {
     const char* ptr;
     int len;
-    aMsg->ReadData(aIter, &ptr, &len);
+    mozilla::Unused << aMsg->ReadData(aIter, &ptr, &len);
     return true;
 }
 
 } // namespace IPC
 
--- a/ipc/ipdl/test/cxx/TestBridgeMain.cpp
+++ b/ipc/ipdl/test/cxx/TestBridgeMain.cpp
@@ -68,21 +68,19 @@ TestBridgeMainSubParent::ActorDestroy(Ac
 {
     if (NormalShutdown != why)
         fail("unexpected destruction!");
 
     // ActorDestroy() is just a callback from IPDL-generated code,
     // which needs the top-level actor (this) to stay alive a little
     // longer so other things can be cleaned up.
     MessageLoop::current()->PostTask(
-        FROM_HERE,
-        new DeleteTask<TestBridgeMainSubParent>(this));
+        do_AddRef(new DeleteTask<TestBridgeMainSubParent>(this)));
     XRE_GetIOMessageLoop()->PostTask(
-        FROM_HERE,
-        new DeleteTask<Transport>(mTransport));
+        do_AddRef(new DeleteTask<Transport>(mTransport)));
 }
 
 //-----------------------------------------------------------------------------
 // sub process --- child of main
 TestBridgeMainChild* gBridgeMainChild;
 
 TestBridgeMainChild::TestBridgeMainChild()
     : mSubprocess(nullptr)
@@ -113,18 +111,17 @@ TestBridgeMainChild::RecvStart()
 
 void
 TestBridgeMainChild::ActorDestroy(ActorDestroyReason why)
 {
     if (NormalShutdown != why)
         fail("unexpected destruction!");  
     // NB: this is kosher because QuitChild() joins with the IO thread
     XRE_GetIOMessageLoop()->PostTask(
-        FROM_HERE,
-        new DeleteTask<IPDLUnitTestSubprocess>(mSubprocess));
+        do_AddRef(new DeleteTask<IPDLUnitTestSubprocess>(mSubprocess)));
     QuitChild();
 }
 
 void
 TestBridgeSubParent::Main()
 {
     if (!SendPing())
         fail("sending Ping");
@@ -144,18 +141,17 @@ TestBridgeSubParent::ActorDestroy(ActorD
     if (NormalShutdown != why)
         fail("unexpected destruction!");
     gBridgeMainChild->Close();
 
     // ActorDestroy() is just a callback from IPDL-generated code,
     // which needs the top-level actor (this) to stay alive a little
     // longer so other things can be cleaned up.
     MessageLoop::current()->PostTask(
-        FROM_HERE,
-        new DeleteTask<TestBridgeSubParent>(this));
+        do_AddRef(new DeleteTask<TestBridgeSubParent>(this)));
 }
 
 //-----------------------------------------------------------------------------
 // subsub process --- child of sub
 
 static TestBridgeSubChild* gBridgeSubChild;
 
 TestBridgeSubChild::TestBridgeSubChild()
@@ -202,17 +198,16 @@ TestBridgeMainSubChild::RecvHi()
     if (!CallHelloRpc())
         fail("calling HelloRpc");
     if (!mGotHi)
         fail("didn't answer HiRpc");
 
     // Need to close the channel without message-processing frames on
     // the C++ stack
     MessageLoop::current()->PostTask(
-        FROM_HERE,
         NewRunnableMethod(this, &TestBridgeMainSubChild::Close));
     return true;
 }
 
 bool
 TestBridgeMainSubChild::AnswerHiRpc()
 {
     mGotHi = true;              // d00d
@@ -226,17 +221,15 @@ TestBridgeMainSubChild::ActorDestroy(Act
         fail("unexpected destruction!");  
 
     gBridgeSubChild->Close();
 
     // ActorDestroy() is just a callback from IPDL-generated code,
     // which needs the top-level actor (this) to stay alive a little
     // longer so other things can be cleaned up.
     MessageLoop::current()->PostTask(
-        FROM_HERE,
-        new DeleteTask<TestBridgeMainSubChild>(this));
+        do_AddRef(new DeleteTask<TestBridgeMainSubChild>(this)));
     XRE_GetIOMessageLoop()->PostTask(
-        FROM_HERE,
-        new DeleteTask<Transport>(mTransport));
+        do_AddRef(new DeleteTask<Transport>(mTransport)));
 }
 
 } // namespace mozilla
 } // namespace _ipdltest
--- a/ipc/ipdl/test/cxx/TestCancel.cpp
+++ b/ipc/ipdl/test/cxx/TestCancel.cpp
@@ -79,17 +79,17 @@ TestCancelParent::RecvTest3_2()
     GetIPCChannel()->CancelCurrentTransaction();
     return true;
 }
 
 bool
 TestCancelParent::RecvDone()
 {
     MessageLoop::current()->PostTask(
-	FROM_HERE, NewRunnableMethod(this, &TestCancelParent::Close));
+	NewRunnableMethod(this, &TestCancelParent::Close));
     return true;
 }
 
 bool
 TestCancelParent::RecvCheckParent(uint32_t *reply)
 {
     *reply = 12;
     return true;
--- a/ipc/ipdl/test/cxx/TestCrashCleanup.cpp
+++ b/ipc/ipdl/test/cxx/TestCrashCleanup.cpp
@@ -39,17 +39,16 @@ void DeleteTheWorld()
     // needs to be synchronous to avoid affecting event ordering on
     // the main thread
     Mutex mutex("TestCrashCleanup.DeleteTheWorld.mutex");
     CondVar cvar(mutex, "TestCrashCleanup.DeleteTheWorld.cvar");
 
     MutexAutoLock lock(mutex);
 
     XRE_GetIOMessageLoop()->PostTask(
-      FROM_HERE,
       NewRunnableFunction(DeleteSubprocess, &mutex, &cvar));
 
     cvar.Wait();
 }
 
 void Done()
 {
   static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
@@ -74,24 +73,24 @@ TestCrashCleanupParent::~TestCrashCleanu
         fail("should have been ActorDestroy()d!");
 }
 
 void
 TestCrashCleanupParent::Main()
 {
     // NB: has to be enqueued before IO thread's error notification
     MessageLoop::current()->PostTask(
-        FROM_HERE, NewRunnableFunction(DeleteTheWorld));
+        NewRunnableFunction(DeleteTheWorld));
 
     if (CallDIEDIEDIE())
         fail("expected an error!");
 
     Close();
 
-    MessageLoop::current()->PostTask(FROM_HERE, NewRunnableFunction(Done));
+    MessageLoop::current()->PostTask(NewRunnableFunction(Done));
 }
 
 
 //-----------------------------------------------------------------------------
 // child
 
 TestCrashCleanupChild::TestCrashCleanupChild()
 {
--- a/ipc/ipdl/test/cxx/TestDemon.cpp
+++ b/ipc/ipdl/test/cxx/TestDemon.cpp
@@ -185,18 +185,17 @@ TestDemonParent::RunUnlimitedSequence()
 {
   if (mDone) {
     return;
   }
 
   gFlushStack = false;
   DoAction();
 
-  MessageLoop::current()->PostTask(FROM_HERE,
-                                   NewRunnableMethod(this, &TestDemonParent::RunUnlimitedSequence));
+  MessageLoop::current()->PostTask(NewRunnableMethod(this, &TestDemonParent::RunUnlimitedSequence));
 }
 
 void
 TestDemonParent::RunLimitedSequence(int flags)
 {
   if (gStackHeight >= kMaxStackHeight) {
     return;
   }
@@ -330,18 +329,17 @@ TestDemonChild::RecvHiPrioSyncMessage()
 }
 
 void
 TestDemonChild::RunUnlimitedSequence()
 {
   gFlushStack = false;
   DoAction();
 
-  MessageLoop::current()->PostTask(FROM_HERE,
-                                   NewRunnableMethod(this, &TestDemonChild::RunUnlimitedSequence));
+  MessageLoop::current()->PostTask(NewRunnableMethod(this, &TestDemonChild::RunUnlimitedSequence));
 }
 
 void
 TestDemonChild::RunLimitedSequence()
 {
   if (gStackHeight >= kMaxStackHeight) {
     return;
   }
--- a/ipc/ipdl/test/cxx/TestEndpointBridgeMain.cpp
+++ b/ipc/ipdl/test/cxx/TestEndpointBridgeMain.cpp
@@ -73,21 +73,19 @@ TestEndpointBridgeMainSubParent::ActorDe
   if (NormalShutdown != why) {
     fail("unexpected destruction!");
   }
 
   // ActorDestroy() is just a callback from IPDL-generated code,
   // which needs the top-level actor (this) to stay alive a little
   // longer so other things can be cleaned up.
   MessageLoop::current()->PostTask(
-    FROM_HERE,
-    new DeleteTask<TestEndpointBridgeMainSubParent>(this));
+    do_AddRef(new DeleteTask<TestEndpointBridgeMainSubParent>(this)));
   XRE_GetIOMessageLoop()->PostTask(
-    FROM_HERE,
-    new DeleteTask<Transport>(GetTransport()));
+    do_AddRef(new DeleteTask<Transport>(GetTransport())));
 }
 
 //-----------------------------------------------------------------------------
 // sub process --- child of main
 TestEndpointBridgeMainChild* gEndpointBridgeMainChild;
 
 TestEndpointBridgeMainChild::TestEndpointBridgeMainChild()
  : mSubprocess(nullptr)
@@ -121,18 +119,17 @@ TestEndpointBridgeMainChild::RecvStart()
 void
 TestEndpointBridgeMainChild::ActorDestroy(ActorDestroyReason why)
 {
   if (NormalShutdown != why) {
     fail("unexpected destruction!");
   }
   // NB: this is kosher because QuitChild() joins with the IO thread
   XRE_GetIOMessageLoop()->PostTask(
-    FROM_HERE,
-    new DeleteTask<IPDLUnitTestSubprocess>(mSubprocess));
+    do_AddRef(new DeleteTask<IPDLUnitTestSubprocess>(mSubprocess)));
   QuitChild();
 }
 
 void
 TestEndpointBridgeSubParent::Main()
 {
   if (!SendPing()) {
     fail("sending Ping");
@@ -169,18 +166,17 @@ TestEndpointBridgeSubParent::ActorDestro
     fail("unexpected destruction!");
   }
   gEndpointBridgeMainChild->Close();
 
   // ActorDestroy() is just a callback from IPDL-generated code,
   // which needs the top-level actor (this) to stay alive a little
   // longer so other things can be cleaned up.
   MessageLoop::current()->PostTask(
-    FROM_HERE,
-    new DeleteTask<TestEndpointBridgeSubParent>(this));
+    do_AddRef(new DeleteTask<TestEndpointBridgeSubParent>(this)));
 }
 
 //-----------------------------------------------------------------------------
 // subsub process --- child of sub
 
 static TestEndpointBridgeSubChild* gBridgeSubChild;
 
 TestEndpointBridgeSubChild::TestEndpointBridgeSubChild()
@@ -233,17 +229,16 @@ TestEndpointBridgeMainSubChild::RecvHi()
   }
   if (!mGotHi) {
     fail("didn't answer HiRpc");
   }
 
   // Need to close the channel without message-processing frames on
   // the C++ stack
   MessageLoop::current()->PostTask(
-    FROM_HERE,
     NewRunnableMethod(this, &TestEndpointBridgeMainSubChild::Close));
   return true;
 }
 
 bool
 TestEndpointBridgeMainSubChild::AnswerHiRpc()
 {
   mGotHi = true;              // d00d
@@ -258,17 +253,15 @@ TestEndpointBridgeMainSubChild::ActorDes
   }
 
   gBridgeSubChild->Close();
 
   // ActorDestroy() is just a callback from IPDL-generated code,
   // which needs the top-level actor (this) to stay alive a little
   // longer so other things can be cleaned up.
   MessageLoop::current()->PostTask(
-    FROM_HERE,
-    new DeleteTask<TestEndpointBridgeMainSubChild>(this));
+    do_AddRef(new DeleteTask<TestEndpointBridgeMainSubChild>(this)));
   XRE_GetIOMessageLoop()->PostTask(
-    FROM_HERE,
-    new DeleteTask<Transport>(GetTransport()));
+    do_AddRef(new DeleteTask<Transport>(GetTransport())));
 }
 
 } // namespace mozilla
 } // namespace _ipdltest
--- a/ipc/ipdl/test/cxx/TestEndpointOpens.cpp
+++ b/ipc/ipdl/test/cxx/TestEndpointOpens.cpp
@@ -80,17 +80,16 @@ TestEndpointOpensParent::RecvStartSubpro
 
   gParentThread = new Thread("ParentThread");
   if (!gParentThread->Start()) {
     fail("starting parent thread");
   }
 
   TestEndpointOpensOpenedParent* a = new TestEndpointOpensOpenedParent();
   gParentThread->message_loop()->PostTask(
-    FROM_HERE,
     NewRunnableFunction(OpenParent, a, mozilla::Move(endpoint)));
 
   return true;
 }
 
 void
 TestEndpointOpensParent::ActorDestroy(ActorDestroyReason why)
 {
@@ -129,34 +128,32 @@ static void
 ShutdownTestEndpointOpensOpenedParent(TestEndpointOpensOpenedParent* parent,
                                       Transport* transport)
 {
   delete parent;
 
   // Now delete the transport, which has to happen after the
   // top-level actor is deleted.
   XRE_GetIOMessageLoop()->PostTask(
-    FROM_HERE,
-    new DeleteTask<Transport>(transport));
+    do_AddRef(new DeleteTask<Transport>(transport)));
 }
 
 void
 TestEndpointOpensOpenedParent::ActorDestroy(ActorDestroyReason why)
 {
   AssertNotMainThread();
 
   if (NormalShutdown != why) {
     fail("unexpected destruction B!");
   }
 
   // ActorDestroy() is just a callback from IPDL-generated code,
   // which needs the top-level actor (this) to stay alive a little
   // longer so other things can be cleaned up.
   gParentThread->message_loop()->PostTask(
-    FROM_HERE,
     NewRunnableFunction(ShutdownTestEndpointOpensOpenedParent,
                         this, GetTransport()));
 }
 
 //-----------------------------------------------------------------------------
 // child
 
 static TestEndpointOpensChild* gOpensChild;
@@ -203,17 +200,16 @@ TestEndpointOpensChild::RecvStart()
 
   gChildThread = new Thread("ChildThread");
   if (!gChildThread->Start()) {
     fail("starting child thread");
   }
 
   TestEndpointOpensOpenedChild* a = new TestEndpointOpensOpenedChild();
   gChildThread->message_loop()->PostTask(
-    FROM_HERE,
     NewRunnableFunction(OpenChild, a, mozilla::Move(child)));
 
   if (!SendStartSubprotocol(parent)) {
     fail("send StartSubprotocol");
   }
 
   return true;
 }
@@ -243,17 +239,16 @@ TestEndpointOpensOpenedChild::RecvHi()
   }
   if (!mGotHi) {
     fail("didn't answer HiRpc");
   }
 
   // Need to close the channel without message-processing frames on
   // the C++ stack
   MessageLoop::current()->PostTask(
-    FROM_HERE,
     NewRunnableMethod(this, &TestEndpointOpensOpenedChild::Close));
   return true;
 }
 
 bool
 TestEndpointOpensOpenedChild::AnswerHiRpc()
 {
   AssertNotMainThread();
@@ -266,22 +261,20 @@ static void
 ShutdownTestEndpointOpensOpenedChild(TestEndpointOpensOpenedChild* child,
                                      Transport* transport)
 {
   delete child;
 
   // Now delete the transport, which has to happen after the
   // top-level actor is deleted.
   XRE_GetIOMessageLoop()->PostTask(
-    FROM_HERE,
-    new DeleteTask<Transport>(transport));
+    do_AddRef(new DeleteTask<Transport>(transport)));
 
   // Kick off main-thread shutdown.
   gMainThread->PostTask(
-    FROM_HERE,
     NewRunnableMethod(gOpensChild, &TestEndpointOpensChild::Close));
 }
 
 void
 TestEndpointOpensOpenedChild::ActorDestroy(ActorDestroyReason why)
 {
   AssertNotMainThread();
 
@@ -289,14 +282,13 @@ TestEndpointOpensOpenedChild::ActorDestr
     fail("unexpected destruction D!");
   }
 
   // ActorDestroy() is just a callback from IPDL-generated code,
   // which needs the top-level actor (this) to stay alive a little
   // longer so other things can be cleaned up.  Defer shutdown to
   // let cleanup finish.
   gChildThread->message_loop()->PostTask(
-    FROM_HERE,
     NewRunnableFunction(ShutdownTestEndpointOpensOpenedChild,
                         this, GetTransport()));
 }
 
 } // namespace mozilla
--- a/ipc/ipdl/test/cxx/TestHangs.cpp
+++ b/ipc/ipdl/test/cxx/TestHangs.cpp
@@ -77,17 +77,17 @@ TestHangsParent::ShouldContinueFromReply
     // sleep for a long time, to allow the subprocess's reply to come
     // in
 
     PR_Sleep(5000);
 
     // reply should be here; we'll post a task to shut things down.
     // This must be after OnMaybeDequeueOne() in the event queue.
     MessageLoop::current()->PostTask(
-        FROM_HERE, NewRunnableMethod(this, &TestHangsParent::CleanUp));
+        NewRunnableMethod(this, &TestHangsParent::CleanUp));
 
     GetIPCChannel()->CloseWithTimeout();
 
     return false;
 }
 
 bool
 TestHangsParent::AnswerStackFrame()
--- a/ipc/ipdl/test/cxx/TestInterruptErrorCleanup.cpp
+++ b/ipc/ipdl/test/cxx/TestInterruptErrorCleanup.cpp
@@ -39,17 +39,16 @@ void DeleteTheWorld()
     // needs to be synchronous to avoid affecting event ordering on
     // the main thread
     Mutex mutex("TestInterruptErrorCleanup.DeleteTheWorld.mutex");
     CondVar cvar(mutex, "TestInterruptErrorCleanup.DeleteTheWorld.cvar");
 
     MutexAutoLock lock(mutex);
 
     XRE_GetIOMessageLoop()->PostTask(
-      FROM_HERE,
       NewRunnableFunction(DeleteSubprocess, &mutex, &cvar));
 
     cvar.Wait();
 }
 
 void Done()
 {
   static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
@@ -96,34 +95,34 @@ TestInterruptErrorCleanupParent::Main()
     //  - use-after-free of parentActor
     //  - use-after-free of channel
     //
     // Because of legacy constraints related to nsNPAPI* code, we need
     // to ensure that this sequence of events can occur without
     // errors/crashes.
 
     MessageLoop::current()->PostTask(
-        FROM_HERE, NewRunnableFunction(DeleteTheWorld));
+        NewRunnableFunction(DeleteTheWorld));
 
     // it's a failure if this *succeeds*
     if (CallError())
         fail("expected an error!");
 
     if (!mGotProcessingError)
         fail("expected a ProcessingError() notification");
 
     // it's OK to Close() a channel after an error, because nsNPAPI*
     // wants to do this
     Close();
 
     // we know that this event *must* be after the MaybeError
     // notification enqueued by AsyncChannel, because that event is
     // enqueued within the same mutex that ends up signaling the
     // wakeup-on-error of |CallError()| above
-    MessageLoop::current()->PostTask(FROM_HERE, NewRunnableFunction(Done));
+    MessageLoop::current()->PostTask(NewRunnableFunction(Done));
 }
 
 void
 TestInterruptErrorCleanupParent::ProcessingError(Result aCode, const char* aReason)
 {
     if (aCode != MsgDropped)
         fail("unexpected processing error");
     mGotProcessingError = true;
--- a/ipc/ipdl/test/cxx/TestInterruptRaces.cpp
+++ b/ipc/ipdl/test/cxx/TestInterruptRaces.cpp
@@ -31,34 +31,32 @@ TestInterruptRacesParent::Main()
     if (!SendStart())
         fail("sending Start()");
 }
 
 bool
 TestInterruptRacesParent::RecvStartRace()
 {
     MessageLoop::current()->PostTask(
-        FROM_HERE,
         NewRunnableMethod(this, &TestInterruptRacesParent::OnRaceTime));
     return true;
 }
 
 void
 TestInterruptRacesParent::OnRaceTime()
 {
     if (!CallRace(&mChildHasReply))
         fail("problem calling Race()");
 
     if (!mChildHasReply)
         fail("child should have got a reply already");
 
     mHasReply = true;
 
     MessageLoop::current()->PostTask(
-        FROM_HERE,
         NewRunnableMethod(this, &TestInterruptRacesParent::Test2));
 }
 
 bool
 TestInterruptRacesParent::AnswerRace(bool* hasReply)
 {
     if (mHasReply)
         fail("apparently the parent won the Interrupt race!");
@@ -76,17 +74,16 @@ TestInterruptRacesParent::Test2()
     mChildHasReply = false;
 
     if (!CallStackFrame())
         fail("can't set up a stack frame");
 
     puts("  passed");
 
     MessageLoop::current()->PostTask(
-        FROM_HERE,
         NewRunnableMethod(this, &TestInterruptRacesParent::Test3));
 }
 
 bool
 TestInterruptRacesParent::AnswerStackFrame()
 {
     if (!SendWakeup())
         fail("can't wake up the child");
--- a/ipc/ipdl/test/cxx/TestInterruptShutdownRace.cpp
+++ b/ipc/ipdl/test/cxx/TestInterruptShutdownRace.cpp
@@ -54,17 +54,16 @@ TestInterruptShutdownRaceParent::Main()
 }
 
 bool
 TestInterruptShutdownRaceParent::RecvStartDeath()
 {
     // this will be ordered before the OnMaybeDequeueOne event of
     // Orphan in the queue
     MessageLoop::current()->PostTask(
-        FROM_HERE,
         NewRunnableMethod(this,
                           &TestInterruptShutdownRaceParent::StartShuttingDown));
     return true;
 }
 
 void
 TestInterruptShutdownRaceParent::StartShuttingDown()
 {
@@ -77,22 +76,20 @@ TestInterruptShutdownRaceParent::StartSh
     if (CallExit())
         fail("connection was supposed to be interrupted");
 
     Close();
 
     delete static_cast<TestInterruptShutdownRaceParent*>(gParentActor);
     gParentActor = nullptr;
 
-    XRE_GetIOMessageLoop()->PostTask(FROM_HERE,
-                                     NewRunnableFunction(DeleteSubprocess));
+    XRE_GetIOMessageLoop()->PostTask(NewRunnableFunction(DeleteSubprocess));
 
     // this is ordered after the OnMaybeDequeueOne event in the queue
-    MessageLoop::current()->PostTask(FROM_HERE,
-                                     NewRunnableFunction(Done));
+    MessageLoop::current()->PostTask(NewRunnableFunction(Done));
 
     // |this| has been deleted, be mindful
 }
 
 bool
 TestInterruptShutdownRaceParent::RecvOrphan()
 {
     // it would be nice to fail() here, but we'll process this message
--- a/ipc/ipdl/test/cxx/TestNestedLoops.cpp
+++ b/ipc/ipdl/test/cxx/TestNestedLoops.cpp
@@ -48,17 +48,16 @@ TestNestedLoopsParent::Main()
 
 bool
 TestNestedLoopsParent::RecvNonce()
 {
     // if we have an OnMaybeDequeueOne waiting for us (we may not, due
     // to the inherent race condition in this test, then this event
     // must be ordered after it in the queue
     MessageLoop::current()->PostTask(
-        FROM_HERE,
         NewRunnableMethod(this, &TestNestedLoopsParent::BreakNestedLoop));
 
     // sigh ... spin for a while to let the reply to R arrive
     puts(" (sleeping to wait for reply to R ... sorry)");
     PR_Sleep(5000);
 
     // sigh ... we have no idea when code might do this
     do {
--- a/ipc/ipdl/test/cxx/TestOpens.cpp
+++ b/ipc/ipdl/test/cxx/TestOpens.cpp
@@ -73,17 +73,16 @@ TestOpensParent::AllocPTestOpensOpenedPa
     gMainThread = MessageLoop::current();
 
     gParentThread = new Thread("ParentThread");
     if (!gParentThread->Start())
         fail("starting parent thread");
 
     TestOpensOpenedParent* a = new TestOpensOpenedParent(transport);
     gParentThread->message_loop()->PostTask(
-        FROM_HERE,
         NewRunnableFunction(OpenParent, a, transport, otherPid));
 
     return a;
 }
 
 void
 TestOpensParent::ActorDestroy(ActorDestroyReason why)
 {
@@ -121,33 +120,31 @@ static void
 ShutdownTestOpensOpenedParent(TestOpensOpenedParent* parent,
                               Transport* transport)
 {
     delete parent;
 
     // Now delete the transport, which has to happen after the
     // top-level actor is deleted.
     XRE_GetIOMessageLoop()->PostTask(
-        FROM_HERE,
-        new DeleteTask<Transport>(transport));
+        do_AddRef(new DeleteTask<Transport>(transport)));
 }
 
 void
 TestOpensOpenedParent::ActorDestroy(ActorDestroyReason why)
 {
     AssertNotMainThread();
 
     if (NormalShutdown != why)
         fail("unexpected destruction!");
 
     // ActorDestroy() is just a callback from IPDL-generated code,
     // which needs the top-level actor (this) to stay alive a little
     // longer so other things can be cleaned up.
     gParentThread->message_loop()->PostTask(
-        FROM_HERE,
         NewRunnableFunction(ShutdownTestOpensOpenedParent,
                             this, mTransport));
 }
 
 //-----------------------------------------------------------------------------
 // child
 
 static TestOpensChild* gOpensChild;
@@ -192,17 +189,16 @@ TestOpensChild::AllocPTestOpensOpenedChi
     gMainThread = MessageLoop::current();
 
     gChildThread = new Thread("ChildThread");
     if (!gChildThread->Start())
         fail("starting child thread");
 
     TestOpensOpenedChild* a = new TestOpensOpenedChild(transport);
     gChildThread->message_loop()->PostTask(
-        FROM_HERE,
         NewRunnableFunction(OpenChild, a, transport, otherPid));
 
     return a;
 }
 
 void
 TestOpensChild::ActorDestroy(ActorDestroyReason why)
 {
@@ -224,17 +220,16 @@ TestOpensOpenedChild::RecvHi()
     if (!CallHelloRpc())
         fail("calling HelloRpc");
     if (!mGotHi)
         fail("didn't answer HiRpc");
 
     // Need to close the channel without message-processing frames on
     // the C++ stack
     MessageLoop::current()->PostTask(
-        FROM_HERE,
         NewRunnableMethod(this, &TestOpensOpenedChild::Close));
     return true;
 }
 
 bool
 TestOpensOpenedChild::AnswerHiRpc()
 {
     AssertNotMainThread();
@@ -247,36 +242,33 @@ static void
 ShutdownTestOpensOpenedChild(TestOpensOpenedChild* child,
                              Transport* transport)
 {
     delete child;
 
     // Now delete the transport, which has to happen after the
     // top-level actor is deleted.
     XRE_GetIOMessageLoop()->PostTask(
-        FROM_HERE,
-        new DeleteTask<Transport>(transport));
+        do_AddRef(new DeleteTask<Transport>(transport)));
 
     // Kick off main-thread shutdown.
     gMainThread->PostTask(
-        FROM_HERE,
         NewRunnableMethod(gOpensChild, &TestOpensChild::Close));
 }
 
 void
 TestOpensOpenedChild::ActorDestroy(ActorDestroyReason why)
 {
     AssertNotMainThread();
 
     if (NormalShutdown != why)
         fail("unexpected destruction!");  
 
     // ActorDestroy() is just a callback from IPDL-generated code,
     // which needs the top-level actor (this) to stay alive a little
     // longer so other things can be cleaned up.  Defer shutdown to
     // let cleanup finish.
     gChildThread->message_loop()->PostTask(
-        FROM_HERE,
         NewRunnableFunction(ShutdownTestOpensOpenedChild,
                             this, mTransport));
 }
 
 } // namespace mozilla
--- a/ipc/ipdl/test/cxx/TestRaceDeadlock.cpp
+++ b/ipc/ipdl/test/cxx/TestRaceDeadlock.cpp
@@ -1,16 +1,17 @@
 #include "TestRaceDeadlock.h"
 
 #include "IPDLUnitTests.h"      // fail etc.
 
 // #define TEST_TIMEOUT 5000
 
 using namespace mozilla::ipc;
 typedef mozilla::ipc::MessageChannel::Message Message;
+typedef mozilla::ipc::MessageChannel::MessageInfo MessageInfo;
 
 namespace mozilla {
 namespace _ipdltest {
 
 static RacyInterruptPolicy
 MediateRace(const MessageInfo& parent, const MessageInfo& child)
 {
     return (PTestRaceDeadlock::Msg_Win__ID == parent.type()) ?
--- a/ipc/ipdl/test/cxx/TestRaceDeferral.cpp
+++ b/ipc/ipdl/test/cxx/TestRaceDeferral.cpp
@@ -1,14 +1,15 @@
 #include "TestRaceDeferral.h"
 
 #include "IPDLUnitTests.h"      // fail etc.
 
 using namespace mozilla::ipc;
 typedef mozilla::ipc::MessageChannel::Message Message;
+typedef mozilla::ipc::MessageChannel::MessageInfo MessageInfo;
 
 namespace mozilla {
 namespace _ipdltest {
 
 static RacyInterruptPolicy
 MediateRace(const MessageInfo& parent, const MessageInfo& child)
 {
     return (PTestRaceDeferral::Msg_Win__ID == parent.type()) ?
--- a/ipc/ipdl/test/cxx/TestStackHooks.cpp
+++ b/ipc/ipdl/test/cxx/TestStackHooks.cpp
@@ -76,18 +76,17 @@ TestStackHooksChild::RecvStart()
     if (!mOnStack)
         fail("missed stack notification");
 
     if (0 != mIncallDepth)
         fail("EnteredCall/ExitedCall malfunction");
 
     // kick off tests from a runnable so that we can start with
     // MessageChannel code on the C++ stack
-    MessageLoop::current()->PostTask(FROM_HERE,
-                                     NewRunnableFunction(RunTestsFn));
+    MessageLoop::current()->PostTask(NewRunnableFunction(RunTestsFn));
 
     return true;
 }
 
 bool
 TestStackHooksChild::AnswerStackFrame()
 {
     if (!mOnStack)
--- a/ipc/ipdl/test/cxx/TestSyncHang.cpp
+++ b/ipc/ipdl/test/cxx/TestSyncHang.cpp
@@ -30,32 +30,30 @@ DeleteSyncHangSubprocess(MessageLoop* ui
   delete gSyncHangSubprocess;
 }
 
 void
 DeferredSyncHangParentShutdown()
 {
   // ping to DeleteSubprocess
   XRE_GetIOMessageLoop()->PostTask(
-      FROM_HERE,
       NewRunnableFunction(DeleteSyncHangSubprocess, MessageLoop::current()));
 }
 
 void
 TestSyncHangParent::Main()
 {
   vector<string> args;
   args.push_back("fake/path");
   gSyncHangSubprocess = new mozilla::ipc::GeckoChildProcessHost(GeckoProcessType_Plugin);
   bool launched = gSyncHangSubprocess->SyncLaunch(args, 2);
   if (launched)
     fail("Calling SyncLaunch with an invalid path should return false");
 
-  MessageLoop::current()->PostTask(
-  				   FROM_HERE, NewRunnableFunction(DeferredSyncHangParentShutdown));
+  MessageLoop::current()->PostTask(NewRunnableFunction(DeferredSyncHangParentShutdown));
   Close();
 }
 
 //-----------------------------------------------------------------------------
 // child
 
 TestSyncHangChild::TestSyncHangChild()
 {
--- a/ipc/ipdl/test/cxx/TestUrgentHangs.cpp
+++ b/ipc/ipdl/test/cxx/TestUrgentHangs.cpp
@@ -51,17 +51,16 @@ TestUrgentHangsParent::Main()
         fail("sending Test2");
 
     // Also fails since we haven't gotten a response for Test2 yet.
     if (SendTest3())
         fail("sending Test3");
 
     // Do a second round of testing once the reply to Test2 comes back.
     MessageLoop::current()->PostDelayedTask(
-        FROM_HERE,
         NewRunnableMethod(this, &TestUrgentHangsParent::SecondStage),
         3000);
 }
 
 void
 TestUrgentHangsParent::SecondStage()
 {
     // Send an async message that waits 2 seconds and then sends a sync message
@@ -70,17 +69,16 @@ TestUrgentHangsParent::SecondStage()
         fail("sending Test4");
 
     // Send a sync message that will time out because the child is waiting
     // inside RecvTest4.
     if (SendTest4_1())
         fail("sending Test4_1");
 
     MessageLoop::current()->PostDelayedTask(
-        FROM_HERE,
         NewRunnableMethod(this, &TestUrgentHangsParent::ThirdStage),
         3000);
 }
 
 void
 TestUrgentHangsParent::ThirdStage()
 {
     // The third stage does the same thing as the second stage except that the
@@ -94,17 +92,16 @@ TestUrgentHangsParent::ThirdStage()
 
     // Send a sync message that will time out because the child is waiting
     // inside RecvTest5.
     if (SendTest5_1())
         fail("sending Test5_1");
 
     // Close the channel after the child finishes its work in RecvTest5.
     MessageLoop::current()->PostDelayedTask(
-        FROM_HERE,
         NewRunnableMethod(this, &TestUrgentHangsParent::Close),
         3000);
 }
 
 bool
 TestUrgentHangsParent::RecvTest1_2()
 {
     if (!SendTest1_3())