Backed out changeset a171aae3ae49 (bug 1312960)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sat, 29 Oct 2016 13:44:45 +0200
changeset 320128 c4f2be33044f293bba6518622bbf4043b48e57bb
parent 320127 a171aae3ae491dd52e184735c51924c7a467a0bf
child 320129 ebd1c1823d617cabfc57d3d9325f2be4a28330ec
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)
bugs1312960
milestone52.0a1
backs outa171aae3ae491dd52e184735c51924c7a467a0bf
Backed out changeset a171aae3ae49 (bug 1312960)
ipc/glue/MessageChannel.cpp
ipc/glue/MessageChannel.h
--- a/ipc/glue/MessageChannel.cpp
+++ b/ipc/glue/MessageChannel.cpp
@@ -933,20 +933,16 @@ MessageChannel::OnMessageReceivedFromLin
                                IPC::Message::COMPRESSION_ENABLED);
             mPending.popLast();
         }
     } else if (aMsg.compress_type() == IPC::Message::COMPRESSION_ALL && !mPending.isEmpty()) {
         for (RefPtr<MessageTask> p = mPending.getLast(); p; p = p->getPrevious()) {
             if (p->Msg().type() == aMsg.type() &&
                 p->Msg().routing_id() == aMsg.routing_id())
             {
-                // This message type has compression enabled, and the queue
-                // holds a message with the same message type and routed to the
-                // same destination. Erase it. Note that, since we always
-                // compress these redundancies, There Can Be Only One.
                 compress = true;
                 MOZ_RELEASE_ASSERT(p->Msg().compress_type() == IPC::Message::COMPRESSION_ALL);
                 p->remove();
                 break;
             }
         }
     }
 
@@ -1537,17 +1533,17 @@ void
 MessageChannel::RunMessage(MessageTask& aTask)
 {
     AssertWorkerThread();
     mMonitor->AssertCurrentThreadOwns();
 
     Message& msg = aTask.Msg();
 
     if (!Connected()) {
-        ReportConnectionError("RunMessage");
+        ReportConnectionError("OnMaybeDequeueOne");
         return;
     }
 
     // Check that we're going to run the first message that's valid to run.
 #ifdef DEBUG
     for (RefPtr<MessageTask> task : mPending) {
         if (task == &aTask) {
             break;
@@ -1596,17 +1592,16 @@ MessageChannel::MessageTask::Run()
     if (!isInList()) {
         return NS_OK;
     }
 
     mChannel->RunMessage(*this);
     return NS_OK;
 }
 
-// Warning: This method removes the receiver from whatever list it might be in.
 nsresult
 MessageChannel::MessageTask::Cancel()
 {
     if (!mChannel) {
         return NS_OK;
     }
 
     mChannel->AssertWorkerThread();
@@ -1623,20 +1618,19 @@ MessageChannel::MessageTask::Cancel()
 }
 
 void
 MessageChannel::MessageTask::Post()
 {
     MOZ_RELEASE_ASSERT(!mScheduled);
     MOZ_RELEASE_ASSERT(isInList());
 
-    mScheduled = true;
-
     RefPtr<MessageTask> self = this;
     mChannel->mWorkerLoop->PostTask(self.forget());
+    mScheduled = true;
 }
 
 void
 MessageChannel::MessageTask::Clear()
 {
     mChannel->AssertWorkerThread();
 
     mChannel = nullptr;
--- a/ipc/glue/MessageChannel.h
+++ b/ipc/glue/MessageChannel.h
@@ -457,17 +457,17 @@ class MessageChannel : HasResultCodes
         public LinkedListElement<RefPtr<MessageTask>>
     {
     public:
         explicit MessageTask(MessageChannel* aChannel, Message&& aMessage)
           : mChannel(aChannel), mMessage(Move(aMessage)), mScheduled(false)
         {}
 
         NS_IMETHOD Run() override;
-        nsresult Cancel() override;
+        NS_IMETHOD Cancel() override;
         void Post();
         void Clear();
 
         bool IsScheduled() const { return mScheduled; }
 
         Message& Msg() { return mMessage; }
         const Message& Msg() const { return mMessage; }