Revert "Bug 1310547 - Use CancelableRunnable for mOnChannelConnectedTask (r=dvander)"
☠☠ backed out by e0730d3f6102 ☠ ☠
authorBill McCloskey <billm@mozilla.com>
Fri, 28 Oct 2016 20:14:42 -0700
changeset 320122 cdcde3282769950892c959ed88fe4662596718e4
parent 320121 767af6517e3e5aef9d39bc8f583e2ea576538465
child 320123 8e766e68c91e3a83548d9bc2fea4f6e3fdaea2d3
push id20749
push userryanvm@gmail.com
push dateSat, 29 Oct 2016 13:21:21 +0000
treeherderfx-team@1b170b39ed6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs1310547
milestone52.0a1
Revert "Bug 1310547 - Use CancelableRunnable for mOnChannelConnectedTask (r=dvander)" This reverts commit 163bd81e7d043a3156b53fb660d6a41560d7bceb.
ipc/glue/MessageChannel.cpp
ipc/glue/MessageChannel.h
--- a/ipc/glue/MessageChannel.cpp
+++ b/ipc/glue/MessageChannel.cpp
@@ -507,18 +507,18 @@ MessageChannel::MessageChannel(MessageLi
     mTopFrame = nullptr;
     mIsSyncWaitingOnNonMainThread = false;
 #endif
 
     RefPtr<CancelableRunnable> runnable =
         NewNonOwningCancelableRunnableMethod(this, &MessageChannel::OnMaybeDequeueOne);
     mDequeueOneTask = new RefCountedTask(runnable.forget());
 
-    mOnChannelConnectedTask =
-        NewNonOwningCancelableRunnableMethod(this, &MessageChannel::DispatchOnChannelConnected);
+    runnable = NewNonOwningCancelableRunnableMethod(this, &MessageChannel::DispatchOnChannelConnected);
+    mOnChannelConnectedTask = new RefCountedTask(runnable.forget());
 
 #ifdef OS_WIN
     mEvent = CreateEventW(nullptr, TRUE, FALSE, nullptr);
     MOZ_RELEASE_ASSERT(mEvent, "CreateEvent failed! Nothing is going to work!");
 #endif
 }
 
 MessageChannel::~MessageChannel()
@@ -1938,17 +1938,17 @@ MessageChannel::SetReplyTimeoutMs(int32_
 }
 
 void
 MessageChannel::OnChannelConnected(int32_t peer_id)
 {
     MOZ_RELEASE_ASSERT(!mPeerPidSet);
     mPeerPidSet = true;
     mPeerPid = peer_id;
-    RefPtr<CancelableRunnable> task = mOnChannelConnectedTask;
+    RefPtr<DequeueTask> task = new DequeueTask(mOnChannelConnectedTask);
     mWorkerLoop->PostTask(task.forget());
 }
 
 void
 MessageChannel::DispatchOnChannelConnected()
 {
     AssertWorkerThread();
     MOZ_RELEASE_ASSERT(mPeerPidSet);
--- a/ipc/glue/MessageChannel.h
+++ b/ipc/glue/MessageChannel.h
@@ -783,17 +783,17 @@ class MessageChannel : HasResultCodes
     bool mNotifiedChannelDone;
 
     // See SetChannelFlags
     ChannelFlags mFlags;
 
     // Task and state used to asynchronously notify channel has been connected
     // safely.  This is necessary to be able to cancel notification if we are
     // closed at the same time.
-    RefPtr<CancelableRunnable> mOnChannelConnectedTask;
+    RefPtr<RefCountedTask> mOnChannelConnectedTask;
     bool mPeerPidSet;
     int32_t mPeerPid;
 };
 
 void
 CancelCPOWs();
 
 } // namespace ipc