Bug 1483248 Part 2 - Always forward destroy messages to recording TabChild, r=mccr8.
authorBrian Hackett <bhackett1024@gmail.com>
Tue, 21 Aug 2018 00:59:18 +0000
changeset 487744 b8d0b116540260b8e76953bd39a8c4d60dd0899b
parent 487743 929bae71da4c94c8c74d5b8089fb87411ad24bf3
child 487745 0e8748072c49da9d46e63aeb941ef7b2d7ccfaae
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs1483248
milestone63.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 1483248 Part 2 - Always forward destroy messages to recording TabChild, r=mccr8.
toolkit/recordreplay/ipc/ParentForwarding.cpp
--- a/toolkit/recordreplay/ipc/ParentForwarding.cpp
+++ b/toolkit/recordreplay/ipc/ParentForwarding.cpp
@@ -105,16 +105,28 @@ HandleMessageInMiddleman(ipc::Side aSide
     ipc::IProtocol::Result r = compositorChild->OnMessageReceived(aMessage);
     MOZ_RELEASE_ASSERT(r == ipc::IProtocol::MsgProcessed);
     return true;
   }
 
   return false;
 }
 
+// Return whether a message should be sent to the recording child, even if it
+// is not currently active.
+static bool
+AlwaysForwardMessage(const IPC::Message& aMessage)
+{
+  IPC::Message::msgid_t type = aMessage.type();
+
+  // Forward close messages so that the tab shuts down properly even if it is
+  // currently replaying.
+  return type == dom::PBrowser::Msg_Destroy__ID;
+}
+
 static bool gMainThreadIsWaitingForIPDLReply = false;
 
 bool
 MainThreadIsWaitingForIPDLReply()
 {
   return gMainThreadIsWaitingForIPDLReply;
 }
 
@@ -149,17 +161,17 @@ public:
     , mOppositeMessageLoop(nullptr)
   {}
 
   virtual void RemoveManagee(int32_t, IProtocol*) override {
     MOZ_CRASH("MiddlemanProtocol::RemoveManagee");
   }
 
   static void ForwardMessageAsync(MiddlemanProtocol* aProtocol, Message* aMessage) {
-    if (ActiveChildIsRecording()) {
+    if (ActiveChildIsRecording() || AlwaysForwardMessage(*aMessage)) {
       PrintSpew("ForwardAsyncMsg %s %s %d\n",
                 (aProtocol->mSide == ipc::ChildSide) ? "Child" : "Parent",
                 IPC::StringFromIPCMessageType(aMessage->type()),
                 (int) aMessage->routing_id());
       if (!aProtocol->GetIPCChannel()->Send(aMessage)) {
         MOZ_CRASH("MiddlemanProtocol::ForwardMessageAsync");
       }
     } else {